|
| 1 | +package software.amazon.awssdk.services.jsonprotocoltests.model; |
| 2 | + |
| 3 | +import java.io.Serializable; |
| 4 | +import java.util.Arrays; |
| 5 | +import java.util.Collections; |
| 6 | +import java.util.HashMap; |
| 7 | +import java.util.List; |
| 8 | +import java.util.Map; |
| 9 | +import java.util.Objects; |
| 10 | +import java.util.Optional; |
| 11 | +import java.util.function.BiConsumer; |
| 12 | +import java.util.function.Function; |
| 13 | +import software.amazon.awssdk.annotations.Generated; |
| 14 | +import software.amazon.awssdk.annotations.Mutable; |
| 15 | +import software.amazon.awssdk.annotations.NotThreadSafe; |
| 16 | +import software.amazon.awssdk.core.SdkField; |
| 17 | +import software.amazon.awssdk.core.SdkPojo; |
| 18 | +import software.amazon.awssdk.core.protocol.MarshallLocation; |
| 19 | +import software.amazon.awssdk.core.protocol.MarshallingType; |
| 20 | +import software.amazon.awssdk.core.traits.LocationTrait; |
| 21 | +import software.amazon.awssdk.utils.ToString; |
| 22 | +import software.amazon.awssdk.utils.builder.CopyableBuilder; |
| 23 | +import software.amazon.awssdk.utils.builder.ToCopyableBuilder; |
| 24 | + |
| 25 | +/** |
| 26 | + */ |
| 27 | +@Generated("software.amazon.awssdk:codegen") |
| 28 | +public final class ContainsReservedKeyword implements SdkPojo, Serializable, |
| 29 | + ToCopyableBuilder<ContainsReservedKeyword.Builder, ContainsReservedKeyword> { |
| 30 | + private static final SdkField<String> NUL_FIELD = SdkField.<String> builder(MarshallingType.STRING).memberName("NUL") |
| 31 | + .getter(getter(ContainsReservedKeyword::nul)).setter(setter(Builder::nul)) |
| 32 | + .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NULL").build()).build(); |
| 33 | + |
| 34 | + private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NUL_FIELD)); |
| 35 | + |
| 36 | + private static final Map<String, SdkField<?>> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); |
| 37 | + |
| 38 | + private static final long serialVersionUID = 1L; |
| 39 | + |
| 40 | + private final String nul; |
| 41 | + |
| 42 | + private ContainsReservedKeyword(BuilderImpl builder) { |
| 43 | + this.nul = builder.nul; |
| 44 | + } |
| 45 | + |
| 46 | + /** |
| 47 | + * Returns the value of the NUL property for this object. |
| 48 | + * |
| 49 | + * @return The value of the NUL property for this object. |
| 50 | + */ |
| 51 | + public final String nul() { |
| 52 | + return nul; |
| 53 | + } |
| 54 | + |
| 55 | + @Override |
| 56 | + public Builder toBuilder() { |
| 57 | + return new BuilderImpl(this); |
| 58 | + } |
| 59 | + |
| 60 | + public static Builder builder() { |
| 61 | + return new BuilderImpl(); |
| 62 | + } |
| 63 | + |
| 64 | + public static Class<? extends Builder> serializableBuilderClass() { |
| 65 | + return BuilderImpl.class; |
| 66 | + } |
| 67 | + |
| 68 | + @Override |
| 69 | + public final int hashCode() { |
| 70 | + int hashCode = 1; |
| 71 | + hashCode = 31 * hashCode + Objects.hashCode(nul()); |
| 72 | + return hashCode; |
| 73 | + } |
| 74 | + |
| 75 | + @Override |
| 76 | + public final boolean equals(Object obj) { |
| 77 | + return equalsBySdkFields(obj); |
| 78 | + } |
| 79 | + |
| 80 | + @Override |
| 81 | + public final boolean equalsBySdkFields(Object obj) { |
| 82 | + if (this == obj) { |
| 83 | + return true; |
| 84 | + } |
| 85 | + if (obj == null) { |
| 86 | + return false; |
| 87 | + } |
| 88 | + if (!(obj instanceof ContainsReservedKeyword)) { |
| 89 | + return false; |
| 90 | + } |
| 91 | + ContainsReservedKeyword other = (ContainsReservedKeyword) obj; |
| 92 | + return Objects.equals(nul(), other.nul()); |
| 93 | + } |
| 94 | + |
| 95 | + /** |
| 96 | + * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be |
| 97 | + * redacted from this string using a placeholder value. |
| 98 | + */ |
| 99 | + @Override |
| 100 | + public final String toString() { |
| 101 | + return ToString.builder("ContainsReservedKeyword").add("NUL", nul()).build(); |
| 102 | + } |
| 103 | + |
| 104 | + public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { |
| 105 | + switch (fieldName) { |
| 106 | + case "NUL": |
| 107 | + return Optional.ofNullable(clazz.cast(nul())); |
| 108 | + default: |
| 109 | + return Optional.empty(); |
| 110 | + } |
| 111 | + } |
| 112 | + |
| 113 | + @Override |
| 114 | + public final List<SdkField<?>> sdkFields() { |
| 115 | + return SDK_FIELDS; |
| 116 | + } |
| 117 | + |
| 118 | + @Override |
| 119 | + public final Map<String, SdkField<?>> sdkFieldNameToField() { |
| 120 | + return SDK_NAME_TO_FIELD; |
| 121 | + } |
| 122 | + |
| 123 | + private static Map<String, SdkField<?>> memberNameToFieldInitializer() { |
| 124 | + Map<String, SdkField<?>> map = new HashMap<>(); |
| 125 | + map.put("NULL", NUL_FIELD); |
| 126 | + return Collections.unmodifiableMap(map); |
| 127 | + } |
| 128 | + |
| 129 | + private static <T> Function<Object, T> getter(Function<ContainsReservedKeyword, T> g) { |
| 130 | + return obj -> g.apply((ContainsReservedKeyword) obj); |
| 131 | + } |
| 132 | + |
| 133 | + private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) { |
| 134 | + return (obj, val) -> s.accept((Builder) obj, val); |
| 135 | + } |
| 136 | + |
| 137 | + @Mutable |
| 138 | + @NotThreadSafe |
| 139 | + public interface Builder extends SdkPojo, CopyableBuilder<Builder, ContainsReservedKeyword> { |
| 140 | + /** |
| 141 | + * Sets the value of the NUL property for this object. |
| 142 | + * |
| 143 | + * @param nul |
| 144 | + * The new value for the NUL property for this object. |
| 145 | + * @return Returns a reference to this object so that method calls can be chained together. |
| 146 | + */ |
| 147 | + Builder nul(String nul); |
| 148 | + } |
| 149 | + |
| 150 | + static final class BuilderImpl implements Builder { |
| 151 | + private String nul; |
| 152 | + |
| 153 | + private BuilderImpl() { |
| 154 | + } |
| 155 | + |
| 156 | + private BuilderImpl(ContainsReservedKeyword model) { |
| 157 | + nul(model.nul); |
| 158 | + } |
| 159 | + |
| 160 | + public final String getNul() { |
| 161 | + return nul; |
| 162 | + } |
| 163 | + |
| 164 | + public final void setNul(String nul) { |
| 165 | + this.nul = nul; |
| 166 | + } |
| 167 | + |
| 168 | + public final void setNull(String nul) { |
| 169 | + this.nul = nul; |
| 170 | + } |
| 171 | + |
| 172 | + @Override |
| 173 | + public final Builder nul(String nul) { |
| 174 | + this.nul = nul; |
| 175 | + return this; |
| 176 | + } |
| 177 | + |
| 178 | + @Override |
| 179 | + public ContainsReservedKeyword build() { |
| 180 | + return new ContainsReservedKeyword(this); |
| 181 | + } |
| 182 | + |
| 183 | + @Override |
| 184 | + public List<SdkField<?>> sdkFields() { |
| 185 | + return SDK_FIELDS; |
| 186 | + } |
| 187 | + |
| 188 | + @Override |
| 189 | + public Map<String, SdkField<?>> sdkFieldNameToField() { |
| 190 | + return SDK_NAME_TO_FIELD; |
| 191 | + } |
| 192 | + } |
| 193 | +} |
0 commit comments