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

software.amazon.awssdk.services.managedblockchainquery.model.BatchGetTokenBalanceInputItem Maven / Gradle / Ivy

/*
 * 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.managedblockchainquery.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;

/**
 * 

* The container for the input for getting a token balance. *

*/ @Generated("software.amazon.awssdk:codegen") public final class BatchGetTokenBalanceInputItem implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField TOKEN_IDENTIFIER_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("tokenIdentifier") .getter(getter(BatchGetTokenBalanceInputItem::tokenIdentifier)).setter(setter(Builder::tokenIdentifier)) .constructor(TokenIdentifier::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tokenIdentifier").build()).build(); private static final SdkField OWNER_IDENTIFIER_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("ownerIdentifier") .getter(getter(BatchGetTokenBalanceInputItem::ownerIdentifier)).setter(setter(Builder::ownerIdentifier)) .constructor(OwnerIdentifier::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ownerIdentifier").build()).build(); private static final SdkField AT_BLOCKCHAIN_INSTANT_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("atBlockchainInstant") .getter(getter(BatchGetTokenBalanceInputItem::atBlockchainInstant)).setter(setter(Builder::atBlockchainInstant)) .constructor(BlockchainInstant::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("atBlockchainInstant").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TOKEN_IDENTIFIER_FIELD, OWNER_IDENTIFIER_FIELD, AT_BLOCKCHAIN_INSTANT_FIELD)); private static final long serialVersionUID = 1L; private final TokenIdentifier tokenIdentifier; private final OwnerIdentifier ownerIdentifier; private final BlockchainInstant atBlockchainInstant; private BatchGetTokenBalanceInputItem(BuilderImpl builder) { this.tokenIdentifier = builder.tokenIdentifier; this.ownerIdentifier = builder.ownerIdentifier; this.atBlockchainInstant = builder.atBlockchainInstant; } /** * Returns the value of the TokenIdentifier property for this object. * * @return The value of the TokenIdentifier property for this object. */ public final TokenIdentifier tokenIdentifier() { return tokenIdentifier; } /** * Returns the value of the OwnerIdentifier property for this object. * * @return The value of the OwnerIdentifier property for this object. */ public final OwnerIdentifier ownerIdentifier() { return ownerIdentifier; } /** * Returns the value of the AtBlockchainInstant property for this object. * * @return The value of the AtBlockchainInstant property for this object. */ public final BlockchainInstant atBlockchainInstant() { return atBlockchainInstant; } @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(tokenIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(ownerIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(atBlockchainInstant()); 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 BatchGetTokenBalanceInputItem)) { return false; } BatchGetTokenBalanceInputItem other = (BatchGetTokenBalanceInputItem) obj; return Objects.equals(tokenIdentifier(), other.tokenIdentifier()) && Objects.equals(ownerIdentifier(), other.ownerIdentifier()) && Objects.equals(atBlockchainInstant(), other.atBlockchainInstant()); } /** * 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("BatchGetTokenBalanceInputItem").add("TokenIdentifier", tokenIdentifier()) .add("OwnerIdentifier", ownerIdentifier()).add("AtBlockchainInstant", atBlockchainInstant()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "tokenIdentifier": return Optional.ofNullable(clazz.cast(tokenIdentifier())); case "ownerIdentifier": return Optional.ofNullable(clazz.cast(ownerIdentifier())); case "atBlockchainInstant": return Optional.ofNullable(clazz.cast(atBlockchainInstant())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((BatchGetTokenBalanceInputItem) 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 TokenIdentifier property for this object. * * @param tokenIdentifier * The new value for the TokenIdentifier property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tokenIdentifier(TokenIdentifier tokenIdentifier); /** * Sets the value of the TokenIdentifier property for this object. * * This is a convenience method that creates an instance of the {@link TokenIdentifier.Builder} avoiding the * need to create one manually via {@link TokenIdentifier#builder()}. * *

* When the {@link Consumer} completes, {@link TokenIdentifier.Builder#build()} is called immediately and its * result is passed to {@link #tokenIdentifier(TokenIdentifier)}. * * @param tokenIdentifier * a consumer that will call methods on {@link TokenIdentifier.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #tokenIdentifier(TokenIdentifier) */ default Builder tokenIdentifier(Consumer tokenIdentifier) { return tokenIdentifier(TokenIdentifier.builder().applyMutation(tokenIdentifier).build()); } /** * Sets the value of the OwnerIdentifier property for this object. * * @param ownerIdentifier * The new value for the OwnerIdentifier property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ownerIdentifier(OwnerIdentifier ownerIdentifier); /** * Sets the value of the OwnerIdentifier property for this object. * * This is a convenience method that creates an instance of the {@link OwnerIdentifier.Builder} avoiding the * need to create one manually via {@link OwnerIdentifier#builder()}. * *

* When the {@link Consumer} completes, {@link OwnerIdentifier.Builder#build()} is called immediately and its * result is passed to {@link #ownerIdentifier(OwnerIdentifier)}. * * @param ownerIdentifier * a consumer that will call methods on {@link OwnerIdentifier.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #ownerIdentifier(OwnerIdentifier) */ default Builder ownerIdentifier(Consumer ownerIdentifier) { return ownerIdentifier(OwnerIdentifier.builder().applyMutation(ownerIdentifier).build()); } /** * Sets the value of the AtBlockchainInstant property for this object. * * @param atBlockchainInstant * The new value for the AtBlockchainInstant property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder atBlockchainInstant(BlockchainInstant atBlockchainInstant); /** * Sets the value of the AtBlockchainInstant property for this object. * * This is a convenience method that creates an instance of the {@link BlockchainInstant.Builder} avoiding the * need to create one manually via {@link BlockchainInstant#builder()}. * *

* When the {@link Consumer} completes, {@link BlockchainInstant.Builder#build()} is called immediately and its * result is passed to {@link #atBlockchainInstant(BlockchainInstant)}. * * @param atBlockchainInstant * a consumer that will call methods on {@link BlockchainInstant.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #atBlockchainInstant(BlockchainInstant) */ default Builder atBlockchainInstant(Consumer atBlockchainInstant) { return atBlockchainInstant(BlockchainInstant.builder().applyMutation(atBlockchainInstant).build()); } } static final class BuilderImpl implements Builder { private TokenIdentifier tokenIdentifier; private OwnerIdentifier ownerIdentifier; private BlockchainInstant atBlockchainInstant; private BuilderImpl() { } private BuilderImpl(BatchGetTokenBalanceInputItem model) { tokenIdentifier(model.tokenIdentifier); ownerIdentifier(model.ownerIdentifier); atBlockchainInstant(model.atBlockchainInstant); } public final TokenIdentifier.Builder getTokenIdentifier() { return tokenIdentifier != null ? tokenIdentifier.toBuilder() : null; } public final void setTokenIdentifier(TokenIdentifier.BuilderImpl tokenIdentifier) { this.tokenIdentifier = tokenIdentifier != null ? tokenIdentifier.build() : null; } @Override public final Builder tokenIdentifier(TokenIdentifier tokenIdentifier) { this.tokenIdentifier = tokenIdentifier; return this; } public final OwnerIdentifier.Builder getOwnerIdentifier() { return ownerIdentifier != null ? ownerIdentifier.toBuilder() : null; } public final void setOwnerIdentifier(OwnerIdentifier.BuilderImpl ownerIdentifier) { this.ownerIdentifier = ownerIdentifier != null ? ownerIdentifier.build() : null; } @Override public final Builder ownerIdentifier(OwnerIdentifier ownerIdentifier) { this.ownerIdentifier = ownerIdentifier; return this; } public final BlockchainInstant.Builder getAtBlockchainInstant() { return atBlockchainInstant != null ? atBlockchainInstant.toBuilder() : null; } public final void setAtBlockchainInstant(BlockchainInstant.BuilderImpl atBlockchainInstant) { this.atBlockchainInstant = atBlockchainInstant != null ? atBlockchainInstant.build() : null; } @Override public final Builder atBlockchainInstant(BlockchainInstant atBlockchainInstant) { this.atBlockchainInstant = atBlockchainInstant; return this; } @Override public BatchGetTokenBalanceInputItem build() { return new BatchGetTokenBalanceInputItem(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy