software.amazon.awssdk.services.connect.model.HierarchyGroups Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of connect Show documentation
Show all versions of connect Show documentation
The AWS Java SDK for Connect module holds the client classes that are used for
communicating with Connect.
/*
* Copyright 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.connect.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Information about the agent hierarchy. Hierarchies can be configured with up to five levels.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class HierarchyGroups implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField LEVEL1_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Level1").getter(getter(HierarchyGroups::level1))
.setter(setter(Builder::level1)).constructor(AgentHierarchyGroup::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Level1").build()).build();
private static final SdkField LEVEL2_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Level2").getter(getter(HierarchyGroups::level2))
.setter(setter(Builder::level2)).constructor(AgentHierarchyGroup::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Level2").build()).build();
private static final SdkField LEVEL3_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Level3").getter(getter(HierarchyGroups::level3))
.setter(setter(Builder::level3)).constructor(AgentHierarchyGroup::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Level3").build()).build();
private static final SdkField LEVEL4_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Level4").getter(getter(HierarchyGroups::level4))
.setter(setter(Builder::level4)).constructor(AgentHierarchyGroup::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Level4").build()).build();
private static final SdkField LEVEL5_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Level5").getter(getter(HierarchyGroups::level5))
.setter(setter(Builder::level5)).constructor(AgentHierarchyGroup::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Level5").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(LEVEL1_FIELD, LEVEL2_FIELD,
LEVEL3_FIELD, LEVEL4_FIELD, LEVEL5_FIELD));
private static final long serialVersionUID = 1L;
private final AgentHierarchyGroup level1;
private final AgentHierarchyGroup level2;
private final AgentHierarchyGroup level3;
private final AgentHierarchyGroup level4;
private final AgentHierarchyGroup level5;
private HierarchyGroups(BuilderImpl builder) {
this.level1 = builder.level1;
this.level2 = builder.level2;
this.level3 = builder.level3;
this.level4 = builder.level4;
this.level5 = builder.level5;
}
/**
*
* The group at level one of the agent hierarchy.
*
*
* @return The group at level one of the agent hierarchy.
*/
public final AgentHierarchyGroup level1() {
return level1;
}
/**
*
* The group at level two of the agent hierarchy.
*
*
* @return The group at level two of the agent hierarchy.
*/
public final AgentHierarchyGroup level2() {
return level2;
}
/**
*
* The group at level three of the agent hierarchy.
*
*
* @return The group at level three of the agent hierarchy.
*/
public final AgentHierarchyGroup level3() {
return level3;
}
/**
*
* The group at level four of the agent hierarchy.
*
*
* @return The group at level four of the agent hierarchy.
*/
public final AgentHierarchyGroup level4() {
return level4;
}
/**
*
* The group at level five of the agent hierarchy.
*
*
* @return The group at level five of the agent hierarchy.
*/
public final AgentHierarchyGroup level5() {
return level5;
}
@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 final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(level1());
hashCode = 31 * hashCode + Objects.hashCode(level2());
hashCode = 31 * hashCode + Objects.hashCode(level3());
hashCode = 31 * hashCode + Objects.hashCode(level4());
hashCode = 31 * hashCode + Objects.hashCode(level5());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof HierarchyGroups)) {
return false;
}
HierarchyGroups other = (HierarchyGroups) obj;
return Objects.equals(level1(), other.level1()) && Objects.equals(level2(), other.level2())
&& Objects.equals(level3(), other.level3()) && Objects.equals(level4(), other.level4())
&& Objects.equals(level5(), other.level5());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("HierarchyGroups").add("Level1", level1()).add("Level2", level2()).add("Level3", level3())
.add("Level4", level4()).add("Level5", level5()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Level1":
return Optional.ofNullable(clazz.cast(level1()));
case "Level2":
return Optional.ofNullable(clazz.cast(level2()));
case "Level3":
return Optional.ofNullable(clazz.cast(level3()));
case "Level4":
return Optional.ofNullable(clazz.cast(level4()));
case "Level5":
return Optional.ofNullable(clazz.cast(level5()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function