Class TokenAssociateTransactionBody.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<TokenAssociateTransactionBody,TokenAssociateTransactionBody.Builder>
com.google.protobuf.GeneratedMessageLite.Builder<TokenAssociateTransactionBody,TokenAssociateTransactionBody.Builder>
com.hedera.hashgraph.sdk.proto.TokenAssociateTransactionBody.Builder
All Implemented Interfaces:
com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, TokenAssociateTransactionBodyOrBuilder, Cloneable
Enclosing class:
TokenAssociateTransactionBody

public static final class TokenAssociateTransactionBody.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<TokenAssociateTransactionBody,TokenAssociateTransactionBody.Builder> implements TokenAssociateTransactionBodyOrBuilder
 *
 Associate an Hedera Token Service (HTS) token and an account.

 An association MUST exist between an account and a token before that
 account may transfer or receive that token.<br/>
 If the identified account is not found,
 the transaction SHALL return `INVALID_ACCOUNT_ID`.<br/>
 If the identified account has been deleted,
 the transaction SHALL return `ACCOUNT_DELETED`.<br/>
 If any of the identified tokens is not found,
 the transaction SHALL return `INVALID_TOKEN_REF`.<br/>
 If any of the identified tokens has been deleted,
 the transaction SHALL return `TOKEN_WAS_DELETED`.<br/>
 If an association already exists for any of the identified tokens,
 the transaction SHALL return `TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT`.<br/>
 The identified account MUST sign this transaction.

 ### Block Stream Effects
 None
 
Protobuf type proto.TokenAssociateTransactionBody
  • Method Details

    • hasAccount

      public boolean hasAccount()
       *
       An account identifier.
       <p>
       The identified account SHALL be associated to each of the
       tokens identified in the `tokens` field.<br/>
       This field is REQUIRED and MUST be a valid account identifier.<br/>
       The identified account MUST exist in state.<br/>
       The identified account MUST NOT be deleted.<br/>
       The identified account MUST NOT be expired.
       
      .proto.AccountID account = 1;
      Specified by:
      hasAccount in interface TokenAssociateTransactionBodyOrBuilder
      Returns:
      Whether the account field is set.
    • getAccount

      public AccountID getAccount()
       *
       An account identifier.
       <p>
       The identified account SHALL be associated to each of the
       tokens identified in the `tokens` field.<br/>
       This field is REQUIRED and MUST be a valid account identifier.<br/>
       The identified account MUST exist in state.<br/>
       The identified account MUST NOT be deleted.<br/>
       The identified account MUST NOT be expired.
       
      .proto.AccountID account = 1;
      Specified by:
      getAccount in interface TokenAssociateTransactionBodyOrBuilder
      Returns:
      The account.
    • setAccount

       *
       An account identifier.
       <p>
       The identified account SHALL be associated to each of the
       tokens identified in the `tokens` field.<br/>
       This field is REQUIRED and MUST be a valid account identifier.<br/>
       The identified account MUST exist in state.<br/>
       The identified account MUST NOT be deleted.<br/>
       The identified account MUST NOT be expired.
       
      .proto.AccountID account = 1;
    • setAccount

      public TokenAssociateTransactionBody.Builder setAccount(AccountID.Builder builderForValue)
       *
       An account identifier.
       <p>
       The identified account SHALL be associated to each of the
       tokens identified in the `tokens` field.<br/>
       This field is REQUIRED and MUST be a valid account identifier.<br/>
       The identified account MUST exist in state.<br/>
       The identified account MUST NOT be deleted.<br/>
       The identified account MUST NOT be expired.
       
      .proto.AccountID account = 1;
    • mergeAccount

      public TokenAssociateTransactionBody.Builder mergeAccount(AccountID value)
       *
       An account identifier.
       <p>
       The identified account SHALL be associated to each of the
       tokens identified in the `tokens` field.<br/>
       This field is REQUIRED and MUST be a valid account identifier.<br/>
       The identified account MUST exist in state.<br/>
       The identified account MUST NOT be deleted.<br/>
       The identified account MUST NOT be expired.
       
      .proto.AccountID account = 1;
    • clearAccount

       *
       An account identifier.
       <p>
       The identified account SHALL be associated to each of the
       tokens identified in the `tokens` field.<br/>
       This field is REQUIRED and MUST be a valid account identifier.<br/>
       The identified account MUST exist in state.<br/>
       The identified account MUST NOT be deleted.<br/>
       The identified account MUST NOT be expired.
       
      .proto.AccountID account = 1;
    • getTokensList

      public List<TokenID> getTokensList()
       *
       A list of token identifiers.
       <p>
       Each token identified in this list SHALL be separately associated with
       the account identified in the `account` field.<br/>
       This list MUST NOT be empty.
       Each entry in this list MUST be a valid token identifier.<br/>
       Each entry in this list MUST NOT be currently associated to the
       account identified in `account`.<br/>
       Each entry in this list MUST NOT be expired.<br/>
       Each entry in this list MUST NOT be deleted.
       
      repeated .proto.TokenID tokens = 2;
      Specified by:
      getTokensList in interface TokenAssociateTransactionBodyOrBuilder
    • getTokensCount

      public int getTokensCount()
       *
       A list of token identifiers.
       <p>
       Each token identified in this list SHALL be separately associated with
       the account identified in the `account` field.<br/>
       This list MUST NOT be empty.
       Each entry in this list MUST be a valid token identifier.<br/>
       Each entry in this list MUST NOT be currently associated to the
       account identified in `account`.<br/>
       Each entry in this list MUST NOT be expired.<br/>
       Each entry in this list MUST NOT be deleted.
       
      repeated .proto.TokenID tokens = 2;
      Specified by:
      getTokensCount in interface TokenAssociateTransactionBodyOrBuilder
    • getTokens

      public TokenID getTokens(int index)
       *
       A list of token identifiers.
       <p>
       Each token identified in this list SHALL be separately associated with
       the account identified in the `account` field.<br/>
       This list MUST NOT be empty.
       Each entry in this list MUST be a valid token identifier.<br/>
       Each entry in this list MUST NOT be currently associated to the
       account identified in `account`.<br/>
       Each entry in this list MUST NOT be expired.<br/>
       Each entry in this list MUST NOT be deleted.
       
      repeated .proto.TokenID tokens = 2;
      Specified by:
      getTokens in interface TokenAssociateTransactionBodyOrBuilder
    • setTokens

      public TokenAssociateTransactionBody.Builder setTokens(int index, TokenID value)
       *
       A list of token identifiers.
       <p>
       Each token identified in this list SHALL be separately associated with
       the account identified in the `account` field.<br/>
       This list MUST NOT be empty.
       Each entry in this list MUST be a valid token identifier.<br/>
       Each entry in this list MUST NOT be currently associated to the
       account identified in `account`.<br/>
       Each entry in this list MUST NOT be expired.<br/>
       Each entry in this list MUST NOT be deleted.
       
      repeated .proto.TokenID tokens = 2;
    • setTokens

      public TokenAssociateTransactionBody.Builder setTokens(int index, TokenID.Builder builderForValue)
       *
       A list of token identifiers.
       <p>
       Each token identified in this list SHALL be separately associated with
       the account identified in the `account` field.<br/>
       This list MUST NOT be empty.
       Each entry in this list MUST be a valid token identifier.<br/>
       Each entry in this list MUST NOT be currently associated to the
       account identified in `account`.<br/>
       Each entry in this list MUST NOT be expired.<br/>
       Each entry in this list MUST NOT be deleted.
       
      repeated .proto.TokenID tokens = 2;
    • addTokens

       *
       A list of token identifiers.
       <p>
       Each token identified in this list SHALL be separately associated with
       the account identified in the `account` field.<br/>
       This list MUST NOT be empty.
       Each entry in this list MUST be a valid token identifier.<br/>
       Each entry in this list MUST NOT be currently associated to the
       account identified in `account`.<br/>
       Each entry in this list MUST NOT be expired.<br/>
       Each entry in this list MUST NOT be deleted.
       
      repeated .proto.TokenID tokens = 2;
    • addTokens

      public TokenAssociateTransactionBody.Builder addTokens(int index, TokenID value)
       *
       A list of token identifiers.
       <p>
       Each token identified in this list SHALL be separately associated with
       the account identified in the `account` field.<br/>
       This list MUST NOT be empty.
       Each entry in this list MUST be a valid token identifier.<br/>
       Each entry in this list MUST NOT be currently associated to the
       account identified in `account`.<br/>
       Each entry in this list MUST NOT be expired.<br/>
       Each entry in this list MUST NOT be deleted.
       
      repeated .proto.TokenID tokens = 2;
    • addTokens

      public TokenAssociateTransactionBody.Builder addTokens(TokenID.Builder builderForValue)
       *
       A list of token identifiers.
       <p>
       Each token identified in this list SHALL be separately associated with
       the account identified in the `account` field.<br/>
       This list MUST NOT be empty.
       Each entry in this list MUST be a valid token identifier.<br/>
       Each entry in this list MUST NOT be currently associated to the
       account identified in `account`.<br/>
       Each entry in this list MUST NOT be expired.<br/>
       Each entry in this list MUST NOT be deleted.
       
      repeated .proto.TokenID tokens = 2;
    • addTokens

      public TokenAssociateTransactionBody.Builder addTokens(int index, TokenID.Builder builderForValue)
       *
       A list of token identifiers.
       <p>
       Each token identified in this list SHALL be separately associated with
       the account identified in the `account` field.<br/>
       This list MUST NOT be empty.
       Each entry in this list MUST be a valid token identifier.<br/>
       Each entry in this list MUST NOT be currently associated to the
       account identified in `account`.<br/>
       Each entry in this list MUST NOT be expired.<br/>
       Each entry in this list MUST NOT be deleted.
       
      repeated .proto.TokenID tokens = 2;
    • addAllTokens

      public TokenAssociateTransactionBody.Builder addAllTokens(Iterable<? extends TokenID> values)
       *
       A list of token identifiers.
       <p>
       Each token identified in this list SHALL be separately associated with
       the account identified in the `account` field.<br/>
       This list MUST NOT be empty.
       Each entry in this list MUST be a valid token identifier.<br/>
       Each entry in this list MUST NOT be currently associated to the
       account identified in `account`.<br/>
       Each entry in this list MUST NOT be expired.<br/>
       Each entry in this list MUST NOT be deleted.
       
      repeated .proto.TokenID tokens = 2;
    • clearTokens

       *
       A list of token identifiers.
       <p>
       Each token identified in this list SHALL be separately associated with
       the account identified in the `account` field.<br/>
       This list MUST NOT be empty.
       Each entry in this list MUST be a valid token identifier.<br/>
       Each entry in this list MUST NOT be currently associated to the
       account identified in `account`.<br/>
       Each entry in this list MUST NOT be expired.<br/>
       Each entry in this list MUST NOT be deleted.
       
      repeated .proto.TokenID tokens = 2;
    • removeTokens

      public TokenAssociateTransactionBody.Builder removeTokens(int index)
       *
       A list of token identifiers.
       <p>
       Each token identified in this list SHALL be separately associated with
       the account identified in the `account` field.<br/>
       This list MUST NOT be empty.
       Each entry in this list MUST be a valid token identifier.<br/>
       Each entry in this list MUST NOT be currently associated to the
       account identified in `account`.<br/>
       Each entry in this list MUST NOT be expired.<br/>
       Each entry in this list MUST NOT be deleted.
       
      repeated .proto.TokenID tokens = 2;