All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.connect.model.HierarchyPath Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Connect module holds the client classes that are used for communicating with Connect.

There is a newer version: 2.29.15
Show newest version
/*
 * 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;

/**
 * 

* Contains information about the levels of a hierarchy group. *

*/ @Generated("software.amazon.awssdk:codegen") public final class HierarchyPath implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField LEVEL_ONE_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("LevelOne") .getter(getter(HierarchyPath::levelOne)).setter(setter(Builder::levelOne)) .constructor(HierarchyGroupSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LevelOne").build()).build(); private static final SdkField LEVEL_TWO_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("LevelTwo") .getter(getter(HierarchyPath::levelTwo)).setter(setter(Builder::levelTwo)) .constructor(HierarchyGroupSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LevelTwo").build()).build(); private static final SdkField LEVEL_THREE_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("LevelThree") .getter(getter(HierarchyPath::levelThree)).setter(setter(Builder::levelThree)) .constructor(HierarchyGroupSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LevelThree").build()).build(); private static final SdkField LEVEL_FOUR_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("LevelFour") .getter(getter(HierarchyPath::levelFour)).setter(setter(Builder::levelFour)) .constructor(HierarchyGroupSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LevelFour").build()).build(); private static final SdkField LEVEL_FIVE_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("LevelFive") .getter(getter(HierarchyPath::levelFive)).setter(setter(Builder::levelFive)) .constructor(HierarchyGroupSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LevelFive").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(LEVEL_ONE_FIELD, LEVEL_TWO_FIELD, LEVEL_THREE_FIELD, LEVEL_FOUR_FIELD, LEVEL_FIVE_FIELD)); private static final long serialVersionUID = 1L; private final HierarchyGroupSummary levelOne; private final HierarchyGroupSummary levelTwo; private final HierarchyGroupSummary levelThree; private final HierarchyGroupSummary levelFour; private final HierarchyGroupSummary levelFive; private HierarchyPath(BuilderImpl builder) { this.levelOne = builder.levelOne; this.levelTwo = builder.levelTwo; this.levelThree = builder.levelThree; this.levelFour = builder.levelFour; this.levelFive = builder.levelFive; } /** *

* Information about level one. *

* * @return Information about level one. */ public final HierarchyGroupSummary levelOne() { return levelOne; } /** *

* Information about level two. *

* * @return Information about level two. */ public final HierarchyGroupSummary levelTwo() { return levelTwo; } /** *

* Information about level three. *

* * @return Information about level three. */ public final HierarchyGroupSummary levelThree() { return levelThree; } /** *

* Information about level four. *

* * @return Information about level four. */ public final HierarchyGroupSummary levelFour() { return levelFour; } /** *

* Information about level five. *

* * @return Information about level five. */ public final HierarchyGroupSummary levelFive() { return levelFive; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(levelOne()); hashCode = 31 * hashCode + Objects.hashCode(levelTwo()); hashCode = 31 * hashCode + Objects.hashCode(levelThree()); hashCode = 31 * hashCode + Objects.hashCode(levelFour()); hashCode = 31 * hashCode + Objects.hashCode(levelFive()); 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 HierarchyPath)) { return false; } HierarchyPath other = (HierarchyPath) obj; return Objects.equals(levelOne(), other.levelOne()) && Objects.equals(levelTwo(), other.levelTwo()) && Objects.equals(levelThree(), other.levelThree()) && Objects.equals(levelFour(), other.levelFour()) && Objects.equals(levelFive(), other.levelFive()); } /** * 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("HierarchyPath").add("LevelOne", levelOne()).add("LevelTwo", levelTwo()) .add("LevelThree", levelThree()).add("LevelFour", levelFour()).add("LevelFive", levelFive()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "LevelOne": return Optional.ofNullable(clazz.cast(levelOne())); case "LevelTwo": return Optional.ofNullable(clazz.cast(levelTwo())); case "LevelThree": return Optional.ofNullable(clazz.cast(levelThree())); case "LevelFour": return Optional.ofNullable(clazz.cast(levelFour())); case "LevelFive": return Optional.ofNullable(clazz.cast(levelFive())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((HierarchyPath) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Information about level one. *

* * @param levelOne * Information about level one. * @return Returns a reference to this object so that method calls can be chained together. */ Builder levelOne(HierarchyGroupSummary levelOne); /** *

* Information about level one. *

* This is a convenience method that creates an instance of the {@link HierarchyGroupSummary.Builder} avoiding * the need to create one manually via {@link HierarchyGroupSummary#builder()}. * *

* When the {@link Consumer} completes, {@link HierarchyGroupSummary.Builder#build()} is called immediately and * its result is passed to {@link #levelOne(HierarchyGroupSummary)}. * * @param levelOne * a consumer that will call methods on {@link HierarchyGroupSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #levelOne(HierarchyGroupSummary) */ default Builder levelOne(Consumer levelOne) { return levelOne(HierarchyGroupSummary.builder().applyMutation(levelOne).build()); } /** *

* Information about level two. *

* * @param levelTwo * Information about level two. * @return Returns a reference to this object so that method calls can be chained together. */ Builder levelTwo(HierarchyGroupSummary levelTwo); /** *

* Information about level two. *

* This is a convenience method that creates an instance of the {@link HierarchyGroupSummary.Builder} avoiding * the need to create one manually via {@link HierarchyGroupSummary#builder()}. * *

* When the {@link Consumer} completes, {@link HierarchyGroupSummary.Builder#build()} is called immediately and * its result is passed to {@link #levelTwo(HierarchyGroupSummary)}. * * @param levelTwo * a consumer that will call methods on {@link HierarchyGroupSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #levelTwo(HierarchyGroupSummary) */ default Builder levelTwo(Consumer levelTwo) { return levelTwo(HierarchyGroupSummary.builder().applyMutation(levelTwo).build()); } /** *

* Information about level three. *

* * @param levelThree * Information about level three. * @return Returns a reference to this object so that method calls can be chained together. */ Builder levelThree(HierarchyGroupSummary levelThree); /** *

* Information about level three. *

* This is a convenience method that creates an instance of the {@link HierarchyGroupSummary.Builder} avoiding * the need to create one manually via {@link HierarchyGroupSummary#builder()}. * *

* When the {@link Consumer} completes, {@link HierarchyGroupSummary.Builder#build()} is called immediately and * its result is passed to {@link #levelThree(HierarchyGroupSummary)}. * * @param levelThree * a consumer that will call methods on {@link HierarchyGroupSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #levelThree(HierarchyGroupSummary) */ default Builder levelThree(Consumer levelThree) { return levelThree(HierarchyGroupSummary.builder().applyMutation(levelThree).build()); } /** *

* Information about level four. *

* * @param levelFour * Information about level four. * @return Returns a reference to this object so that method calls can be chained together. */ Builder levelFour(HierarchyGroupSummary levelFour); /** *

* Information about level four. *

* This is a convenience method that creates an instance of the {@link HierarchyGroupSummary.Builder} avoiding * the need to create one manually via {@link HierarchyGroupSummary#builder()}. * *

* When the {@link Consumer} completes, {@link HierarchyGroupSummary.Builder#build()} is called immediately and * its result is passed to {@link #levelFour(HierarchyGroupSummary)}. * * @param levelFour * a consumer that will call methods on {@link HierarchyGroupSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #levelFour(HierarchyGroupSummary) */ default Builder levelFour(Consumer levelFour) { return levelFour(HierarchyGroupSummary.builder().applyMutation(levelFour).build()); } /** *

* Information about level five. *

* * @param levelFive * Information about level five. * @return Returns a reference to this object so that method calls can be chained together. */ Builder levelFive(HierarchyGroupSummary levelFive); /** *

* Information about level five. *

* This is a convenience method that creates an instance of the {@link HierarchyGroupSummary.Builder} avoiding * the need to create one manually via {@link HierarchyGroupSummary#builder()}. * *

* When the {@link Consumer} completes, {@link HierarchyGroupSummary.Builder#build()} is called immediately and * its result is passed to {@link #levelFive(HierarchyGroupSummary)}. * * @param levelFive * a consumer that will call methods on {@link HierarchyGroupSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #levelFive(HierarchyGroupSummary) */ default Builder levelFive(Consumer levelFive) { return levelFive(HierarchyGroupSummary.builder().applyMutation(levelFive).build()); } } static final class BuilderImpl implements Builder { private HierarchyGroupSummary levelOne; private HierarchyGroupSummary levelTwo; private HierarchyGroupSummary levelThree; private HierarchyGroupSummary levelFour; private HierarchyGroupSummary levelFive; private BuilderImpl() { } private BuilderImpl(HierarchyPath model) { levelOne(model.levelOne); levelTwo(model.levelTwo); levelThree(model.levelThree); levelFour(model.levelFour); levelFive(model.levelFive); } public final HierarchyGroupSummary.Builder getLevelOne() { return levelOne != null ? levelOne.toBuilder() : null; } public final void setLevelOne(HierarchyGroupSummary.BuilderImpl levelOne) { this.levelOne = levelOne != null ? levelOne.build() : null; } @Override public final Builder levelOne(HierarchyGroupSummary levelOne) { this.levelOne = levelOne; return this; } public final HierarchyGroupSummary.Builder getLevelTwo() { return levelTwo != null ? levelTwo.toBuilder() : null; } public final void setLevelTwo(HierarchyGroupSummary.BuilderImpl levelTwo) { this.levelTwo = levelTwo != null ? levelTwo.build() : null; } @Override public final Builder levelTwo(HierarchyGroupSummary levelTwo) { this.levelTwo = levelTwo; return this; } public final HierarchyGroupSummary.Builder getLevelThree() { return levelThree != null ? levelThree.toBuilder() : null; } public final void setLevelThree(HierarchyGroupSummary.BuilderImpl levelThree) { this.levelThree = levelThree != null ? levelThree.build() : null; } @Override public final Builder levelThree(HierarchyGroupSummary levelThree) { this.levelThree = levelThree; return this; } public final HierarchyGroupSummary.Builder getLevelFour() { return levelFour != null ? levelFour.toBuilder() : null; } public final void setLevelFour(HierarchyGroupSummary.BuilderImpl levelFour) { this.levelFour = levelFour != null ? levelFour.build() : null; } @Override public final Builder levelFour(HierarchyGroupSummary levelFour) { this.levelFour = levelFour; return this; } public final HierarchyGroupSummary.Builder getLevelFive() { return levelFive != null ? levelFive.toBuilder() : null; } public final void setLevelFive(HierarchyGroupSummary.BuilderImpl levelFive) { this.levelFive = levelFive != null ? levelFive.build() : null; } @Override public final Builder levelFive(HierarchyGroupSummary levelFive) { this.levelFive = levelFive; return this; } @Override public HierarchyPath build() { return new HierarchyPath(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy