All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.protocolrestjson.model.NestedContainersStructure Maven / Gradle / Ivy
/*
* Copyright 2013-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.protocolrestjson.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class NestedContainersStructure implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField>> LIST_OF_LISTS_OF_STRINGS_FIELD = SdkField
.>> builder(MarshallingType.LIST)
.getter(getter(NestedContainersStructure::listOfListsOfStrings))
.setter(setter(Builder::listOfListsOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfListsOfStrings").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField>> LIST_OF_LISTS_OF_STRUCTS_FIELD = SdkField
.>> builder(MarshallingType.LIST)
.getter(getter(NestedContainersStructure::listOfListsOfStructs))
.setter(setter(Builder::listOfListsOfStructs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfListsOfStructs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField>> LIST_OF_LISTS_OF_ALL_TYPES_STRUCTS_FIELD = SdkField
.>> builder(MarshallingType.LIST)
.getter(getter(NestedContainersStructure::listOfListsOfAllTypesStructs))
.setter(setter(Builder::listOfListsOfAllTypesStructs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfListsOfAllTypesStructs")
.build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(AllTypesStructure::builder)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField>>> LIST_OF_LIST_OF_LISTS_OF_STRINGS_FIELD = SdkField
.>>> builder(MarshallingType.LIST)
.getter(getter(NestedContainersStructure::listOfListOfListsOfStrings))
.setter(setter(Builder::listOfListOfListsOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfListOfListsOfStrings").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.> builder(MarshallingType.LIST)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(
MarshallingType.STRING)
.traits(LocationTrait
.builder()
.location(
MarshallLocation.PAYLOAD)
.locationName(
"member")
.build())
.build()).build())
.build()).build()).build()).build()).build();
private static final SdkField>>> MAP_OF_STRING_TO_LIST_OF_LISTS_OF_STRINGS_FIELD = SdkField
.>>> builder(MarshallingType.MAP)
.getter(getter(NestedContainersStructure::mapOfStringToListOfListsOfStrings))
.setter(setter(Builder::mapOfStringToListOfListsOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToListOfListsOfStrings")
.build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.> builder(MarshallingType.LIST)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(
MarshallingType.STRING)
.traits(LocationTrait
.builder()
.location(
MarshallLocation.PAYLOAD)
.locationName(
"member")
.build())
.build()).build())
.build()).build()).build()).build()).build();
private static final SdkField STRING_MEMBER_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(NestedContainersStructure::stringMember)).setter(setter(Builder::stringMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StringMember").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
LIST_OF_LISTS_OF_STRINGS_FIELD, LIST_OF_LISTS_OF_STRUCTS_FIELD, LIST_OF_LISTS_OF_ALL_TYPES_STRUCTS_FIELD,
LIST_OF_LIST_OF_LISTS_OF_STRINGS_FIELD, MAP_OF_STRING_TO_LIST_OF_LISTS_OF_STRINGS_FIELD, STRING_MEMBER_FIELD));
private static final long serialVersionUID = 1L;
private final List> listOfListsOfStrings;
private final List> listOfListsOfStructs;
private final List> listOfListsOfAllTypesStructs;
private final List>> listOfListOfListsOfStrings;
private final Map>> mapOfStringToListOfListsOfStrings;
private final String stringMember;
private NestedContainersStructure(BuilderImpl builder) {
this.listOfListsOfStrings = builder.listOfListsOfStrings;
this.listOfListsOfStructs = builder.listOfListsOfStructs;
this.listOfListsOfAllTypesStructs = builder.listOfListsOfAllTypesStructs;
this.listOfListOfListsOfStrings = builder.listOfListOfListsOfStrings;
this.mapOfStringToListOfListsOfStrings = builder.mapOfStringToListOfListsOfStrings;
this.stringMember = builder.stringMember;
}
/**
* Returns the value of the ListOfListsOfStrings property for this object.
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return The value of the ListOfListsOfStrings property for this object.
*/
public List> listOfListsOfStrings() {
return listOfListsOfStrings;
}
/**
* Returns the value of the ListOfListsOfStructs property for this object.
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return The value of the ListOfListsOfStructs property for this object.
*/
public List> listOfListsOfStructs() {
return listOfListsOfStructs;
}
/**
* Returns the value of the ListOfListsOfAllTypesStructs property for this object.
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return The value of the ListOfListsOfAllTypesStructs property for this object.
*/
public List> listOfListsOfAllTypesStructs() {
return listOfListsOfAllTypesStructs;
}
/**
* Returns the value of the ListOfListOfListsOfStrings property for this object.
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return The value of the ListOfListOfListsOfStrings property for this object.
*/
public List>> listOfListOfListsOfStrings() {
return listOfListOfListsOfStrings;
}
/**
* Returns the value of the MapOfStringToListOfListsOfStrings property for this object.
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return The value of the MapOfStringToListOfListsOfStrings property for this object.
*/
public Map>> mapOfStringToListOfListsOfStrings() {
return mapOfStringToListOfListsOfStrings;
}
/**
* Returns the value of the StringMember property for this object.
*
* @return The value of the StringMember property for this object.
*/
public String stringMember() {
return stringMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(listOfListsOfStrings());
hashCode = 31 * hashCode + Objects.hashCode(listOfListsOfStructs());
hashCode = 31 * hashCode + Objects.hashCode(listOfListsOfAllTypesStructs());
hashCode = 31 * hashCode + Objects.hashCode(listOfListOfListsOfStrings());
hashCode = 31 * hashCode + Objects.hashCode(mapOfStringToListOfListsOfStrings());
hashCode = 31 * hashCode + Objects.hashCode(stringMember());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof NestedContainersStructure)) {
return false;
}
NestedContainersStructure other = (NestedContainersStructure) obj;
return Objects.equals(listOfListsOfStrings(), other.listOfListsOfStrings())
&& Objects.equals(listOfListsOfStructs(), other.listOfListsOfStructs())
&& Objects.equals(listOfListsOfAllTypesStructs(), other.listOfListsOfAllTypesStructs())
&& Objects.equals(listOfListOfListsOfStrings(), other.listOfListOfListsOfStrings())
&& Objects.equals(mapOfStringToListOfListsOfStrings(), other.mapOfStringToListOfListsOfStrings())
&& Objects.equals(stringMember(), other.stringMember());
}
@Override
public String toString() {
return ToString.builder("NestedContainersStructure").add("ListOfListsOfStrings", listOfListsOfStrings())
.add("ListOfListsOfStructs", listOfListsOfStructs())
.add("ListOfListsOfAllTypesStructs", listOfListsOfAllTypesStructs())
.add("ListOfListOfListsOfStrings", listOfListOfListsOfStrings())
.add("MapOfStringToListOfListsOfStrings", mapOfStringToListOfListsOfStrings())
.add("StringMember", stringMember()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ListOfListsOfStrings":
return Optional.ofNullable(clazz.cast(listOfListsOfStrings()));
case "ListOfListsOfStructs":
return Optional.ofNullable(clazz.cast(listOfListsOfStructs()));
case "ListOfListsOfAllTypesStructs":
return Optional.ofNullable(clazz.cast(listOfListsOfAllTypesStructs()));
case "ListOfListOfListsOfStrings":
return Optional.ofNullable(clazz.cast(listOfListOfListsOfStrings()));
case "MapOfStringToListOfListsOfStrings":
return Optional.ofNullable(clazz.cast(mapOfStringToListOfListsOfStrings()));
case "StringMember":
return Optional.ofNullable(clazz.cast(stringMember()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((NestedContainersStructure) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
* Sets the value of the ListOfListsOfStrings property for this object.
*
* @param listOfListsOfStrings
* The new value for the ListOfListsOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListsOfStrings(Collection extends Collection> listOfListsOfStrings);
/**
* Sets the value of the ListOfListsOfStrings property for this object.
*
* @param listOfListsOfStrings
* The new value for the ListOfListsOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListsOfStrings(Collection... listOfListsOfStrings);
/**
* Sets the value of the ListOfListsOfStructs property for this object.
*
* @param listOfListsOfStructs
* The new value for the ListOfListsOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListsOfStructs(Collection extends Collection> listOfListsOfStructs);
/**
* Sets the value of the ListOfListsOfStructs property for this object.
*
* @param listOfListsOfStructs
* The new value for the ListOfListsOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListsOfStructs(Collection... listOfListsOfStructs);
/**
* Sets the value of the ListOfListsOfAllTypesStructs property for this object.
*
* @param listOfListsOfAllTypesStructs
* The new value for the ListOfListsOfAllTypesStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListsOfAllTypesStructs(Collection extends Collection> listOfListsOfAllTypesStructs);
/**
* Sets the value of the ListOfListsOfAllTypesStructs property for this object.
*
* @param listOfListsOfAllTypesStructs
* The new value for the ListOfListsOfAllTypesStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListsOfAllTypesStructs(Collection... listOfListsOfAllTypesStructs);
/**
* Sets the value of the ListOfListOfListsOfStrings property for this object.
*
* @param listOfListOfListsOfStrings
* The new value for the ListOfListOfListsOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfListsOfStrings(
Collection extends Collection extends Collection>> listOfListOfListsOfStrings);
/**
* Sets the value of the ListOfListOfListsOfStrings property for this object.
*
* @param listOfListOfListsOfStrings
* The new value for the ListOfListOfListsOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfListsOfStrings(Collection extends Collection>... listOfListOfListsOfStrings);
/**
* Sets the value of the MapOfStringToListOfListsOfStrings property for this object.
*
* @param mapOfStringToListOfListsOfStrings
* The new value for the MapOfStringToListOfListsOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToListOfListsOfStrings(
Map>> mapOfStringToListOfListsOfStrings);
/**
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringMember(String stringMember);
}
static final class BuilderImpl implements Builder {
private List> listOfListsOfStrings = DefaultSdkAutoConstructList.getInstance();
private List> listOfListsOfStructs = DefaultSdkAutoConstructList.getInstance();
private List> listOfListsOfAllTypesStructs = DefaultSdkAutoConstructList.getInstance();
private List>> listOfListOfListsOfStrings = DefaultSdkAutoConstructList.getInstance();
private Map>> mapOfStringToListOfListsOfStrings = DefaultSdkAutoConstructMap.getInstance();
private String stringMember;
private BuilderImpl() {
}
private BuilderImpl(NestedContainersStructure model) {
listOfListsOfStrings(model.listOfListsOfStrings);
listOfListsOfStructs(model.listOfListsOfStructs);
listOfListsOfAllTypesStructs(model.listOfListsOfAllTypesStructs);
listOfListOfListsOfStrings(model.listOfListOfListsOfStrings);
mapOfStringToListOfListsOfStrings(model.mapOfStringToListOfListsOfStrings);
stringMember(model.stringMember);
}
public final Collection extends Collection> getListOfListsOfStrings() {
return listOfListsOfStrings;
}
@Override
public final Builder listOfListsOfStrings(Collection extends Collection> listOfListsOfStrings) {
this.listOfListsOfStrings = ListOfListsOfStringsCopier.copy(listOfListsOfStrings);
return this;
}
@Override
@SafeVarargs
public final Builder listOfListsOfStrings(Collection... listOfListsOfStrings) {
listOfListsOfStrings(Arrays.asList(listOfListsOfStrings));
return this;
}
public final void setListOfListsOfStrings(Collection extends Collection> listOfListsOfStrings) {
this.listOfListsOfStrings = ListOfListsOfStringsCopier.copy(listOfListsOfStrings);
}
public final Collection extends Collection> getListOfListsOfStructs() {
return listOfListsOfStructs;
}
@Override
public final Builder listOfListsOfStructs(Collection extends Collection> listOfListsOfStructs) {
this.listOfListsOfStructs = ListOfListsOfStructsCopier.copy(listOfListsOfStructs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfListsOfStructs(Collection... listOfListsOfStructs) {
listOfListsOfStructs(Arrays.asList(listOfListsOfStructs));
return this;
}
public final void setListOfListsOfStructs(Collection extends Collection> listOfListsOfStructs) {
this.listOfListsOfStructs = ListOfListsOfStructsCopier.copy(listOfListsOfStructs);
}
public final Collection extends Collection> getListOfListsOfAllTypesStructs() {
return listOfListsOfAllTypesStructs;
}
@Override
public final Builder listOfListsOfAllTypesStructs(
Collection extends Collection> listOfListsOfAllTypesStructs) {
this.listOfListsOfAllTypesStructs = ListOfListsOfAllTypesStructsCopier.copy(listOfListsOfAllTypesStructs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfListsOfAllTypesStructs(Collection... listOfListsOfAllTypesStructs) {
listOfListsOfAllTypesStructs(Arrays.asList(listOfListsOfAllTypesStructs));
return this;
}
public final void setListOfListsOfAllTypesStructs(
Collection extends Collection> listOfListsOfAllTypesStructs) {
this.listOfListsOfAllTypesStructs = ListOfListsOfAllTypesStructsCopier.copy(listOfListsOfAllTypesStructs);
}
public final Collection extends Collection extends Collection>> getListOfListOfListsOfStrings() {
return listOfListOfListsOfStrings;
}
@Override
public final Builder listOfListOfListsOfStrings(
Collection extends Collection extends Collection>> listOfListOfListsOfStrings) {
this.listOfListOfListsOfStrings = ListOfListOfListsOfStringsCopier.copy(listOfListOfListsOfStrings);
return this;
}
@Override
@SafeVarargs
public final Builder listOfListOfListsOfStrings(Collection extends Collection>... listOfListOfListsOfStrings) {
listOfListOfListsOfStrings(Arrays.asList(listOfListOfListsOfStrings));
return this;
}
public final void setListOfListOfListsOfStrings(
Collection extends Collection extends Collection>> listOfListOfListsOfStrings) {
this.listOfListOfListsOfStrings = ListOfListOfListsOfStringsCopier.copy(listOfListOfListsOfStrings);
}
public final Map>> getMapOfStringToListOfListsOfStrings() {
return mapOfStringToListOfListsOfStrings;
}
@Override
public final Builder mapOfStringToListOfListsOfStrings(
Map>> mapOfStringToListOfListsOfStrings) {
this.mapOfStringToListOfListsOfStrings = MapOfStringToListOfListsOfStringsCopier
.copy(mapOfStringToListOfListsOfStrings);
return this;
}
public final void setMapOfStringToListOfListsOfStrings(
Map>> mapOfStringToListOfListsOfStrings) {
this.mapOfStringToListOfListsOfStrings = MapOfStringToListOfListsOfStringsCopier
.copy(mapOfStringToListOfListsOfStrings);
}
public final String getStringMember() {
return stringMember;
}
@Override
public final Builder stringMember(String stringMember) {
this.stringMember = stringMember;
return this;
}
public final void setStringMember(String stringMember) {
this.stringMember = stringMember;
}
@Override
public NestedContainersStructure build() {
return new NestedContainersStructure(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}