Class TokenRelation.Builder

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

public static final class TokenRelation.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<TokenRelation,TokenRelation.Builder> implements TokenRelationOrBuilder
 *
 An Hedera Token Service token relationship.

 A token relationship connects an Account with a Token and is necessary for
 that Account to transact in that Token. TokenRelationship defines a
 connection between one account and one token type.

 A TokenRelation SHALL be identified by the combination of token_id and
 account_id.<br/>
 A TokenRelation SHALL contain, for the referenced token,<br/>
 The account's current balance, whether the account has KYC granted,
 and whether the assets are frozen.

 TokenRelation entries SHALL be connected via a "virtual linked list" with the
 next TokenID and previous TokenID stored in the TokenRelation.
 These TokenIDs MUST be combined with the AccountID to find the next or
 previous relationship in the list.
 
Protobuf type proto.TokenRelation
  • Method Details

    • hasTokenId

      public boolean hasTokenId()
       *
       A token identifier.
       <p>
       This SHALL identify the token involved in this association.
       
      .proto.TokenID token_id = 1;
      Specified by:
      hasTokenId in interface TokenRelationOrBuilder
      Returns:
      Whether the tokenId field is set.
    • getTokenId

      public TokenID getTokenId()
       *
       A token identifier.
       <p>
       This SHALL identify the token involved in this association.
       
      .proto.TokenID token_id = 1;
      Specified by:
      getTokenId in interface TokenRelationOrBuilder
      Returns:
      The tokenId.
    • setTokenId

      public TokenRelation.Builder setTokenId(TokenID value)
       *
       A token identifier.
       <p>
       This SHALL identify the token involved in this association.
       
      .proto.TokenID token_id = 1;
    • setTokenId

      public TokenRelation.Builder setTokenId(TokenID.Builder builderForValue)
       *
       A token identifier.
       <p>
       This SHALL identify the token involved in this association.
       
      .proto.TokenID token_id = 1;
    • mergeTokenId

      public TokenRelation.Builder mergeTokenId(TokenID value)
       *
       A token identifier.
       <p>
       This SHALL identify the token involved in this association.
       
      .proto.TokenID token_id = 1;
    • clearTokenId

      public TokenRelation.Builder clearTokenId()
       *
       A token identifier.
       <p>
       This SHALL identify the token involved in this association.
       
      .proto.TokenID token_id = 1;
    • hasAccountId

      public boolean hasAccountId()
       *
       An account identifier.
       <p>
       This SHALL identify the account involved in this association.
       
      .proto.AccountID account_id = 2;
      Specified by:
      hasAccountId in interface TokenRelationOrBuilder
      Returns:
      Whether the accountId field is set.
    • getAccountId

      public AccountID getAccountId()
       *
       An account identifier.
       <p>
       This SHALL identify the account involved in this association.
       
      .proto.AccountID account_id = 2;
      Specified by:
      getAccountId in interface TokenRelationOrBuilder
      Returns:
      The accountId.
    • setAccountId

      public TokenRelation.Builder setAccountId(AccountID value)
       *
       An account identifier.
       <p>
       This SHALL identify the account involved in this association.
       
      .proto.AccountID account_id = 2;
    • setAccountId

      public TokenRelation.Builder setAccountId(AccountID.Builder builderForValue)
       *
       An account identifier.
       <p>
       This SHALL identify the account involved in this association.
       
      .proto.AccountID account_id = 2;
    • mergeAccountId

      public TokenRelation.Builder mergeAccountId(AccountID value)
       *
       An account identifier.
       <p>
       This SHALL identify the account involved in this association.
       
      .proto.AccountID account_id = 2;
    • clearAccountId

      public TokenRelation.Builder clearAccountId()
       *
       An account identifier.
       <p>
       This SHALL identify the account involved in this association.
       
      .proto.AccountID account_id = 2;
    • getBalance

      public long getBalance()
       *
       The fungible token balance of this token relationship.
       <p>
       This MUST be a whole number.
       
      int64 balance = 3;
      Specified by:
      getBalance in interface TokenRelationOrBuilder
      Returns:
      The balance.
    • setBalance

      public TokenRelation.Builder setBalance(long value)
       *
       The fungible token balance of this token relationship.
       <p>
       This MUST be a whole number.
       
      int64 balance = 3;
      Parameters:
      value - The balance to set.
      Returns:
      This builder for chaining.
    • clearBalance

      public TokenRelation.Builder clearBalance()
       *
       The fungible token balance of this token relationship.
       <p>
       This MUST be a whole number.
       
      int64 balance = 3;
      Returns:
      This builder for chaining.
    • getFrozen

      public boolean getFrozen()
       *
       A flag indicating that this token relationship is frozen.
       <p>
       When a token relationship is frozen the associated account SHALL NOT be
       permitted to transfer to or from the associated balance.
       <p>
       This flag is associated with the Token value `freeze_key`, and any
       transaction to set this flag MUST be signed by that key. If the Token
       does not have a `freeze_key` set, then this flag SHALL NOT be set true
       for relationships between accounts and that token.
       
      bool frozen = 4;
      Specified by:
      getFrozen in interface TokenRelationOrBuilder
      Returns:
      The frozen.
    • setFrozen

      public TokenRelation.Builder setFrozen(boolean value)
       *
       A flag indicating that this token relationship is frozen.
       <p>
       When a token relationship is frozen the associated account SHALL NOT be
       permitted to transfer to or from the associated balance.
       <p>
       This flag is associated with the Token value `freeze_key`, and any
       transaction to set this flag MUST be signed by that key. If the Token
       does not have a `freeze_key` set, then this flag SHALL NOT be set true
       for relationships between accounts and that token.
       
      bool frozen = 4;
      Parameters:
      value - The frozen to set.
      Returns:
      This builder for chaining.
    • clearFrozen

      public TokenRelation.Builder clearFrozen()
       *
       A flag indicating that this token relationship is frozen.
       <p>
       When a token relationship is frozen the associated account SHALL NOT be
       permitted to transfer to or from the associated balance.
       <p>
       This flag is associated with the Token value `freeze_key`, and any
       transaction to set this flag MUST be signed by that key. If the Token
       does not have a `freeze_key` set, then this flag SHALL NOT be set true
       for relationships between accounts and that token.
       
      bool frozen = 4;
      Returns:
      This builder for chaining.
    • getKycGranted

      public boolean getKycGranted()
       *
       A flag indicating that this token relationship has been granted KYC status.
       <p>
       If the token flag `accounts_kyc_granted_by_default` is set true, then
       this flag SHALL be set true for all accounts subsequently associated to
       that token. Otherwise this flag SHALL NOT be set until a transaction
       is submitted, and signed with the Token `kyc_key` to
       set the flag true.<br/>
       If the Token does not have a `kyc_key` set and the token flag
       `accounts_kyc_granted_by_default` is not set true, then this value MUST
       be false for all accounts subsequently associated to that token.
       <p>
       Typically a transaction to set this value to true is considered
       equivalent to asserting that the "Know Your Customer" (KYC) requirements
       have been met for this combination of account and token and the relevant
       records are available as required.
       
      bool kyc_granted = 5;
      Specified by:
      getKycGranted in interface TokenRelationOrBuilder
      Returns:
      The kycGranted.
    • setKycGranted

      public TokenRelation.Builder setKycGranted(boolean value)
       *
       A flag indicating that this token relationship has been granted KYC status.
       <p>
       If the token flag `accounts_kyc_granted_by_default` is set true, then
       this flag SHALL be set true for all accounts subsequently associated to
       that token. Otherwise this flag SHALL NOT be set until a transaction
       is submitted, and signed with the Token `kyc_key` to
       set the flag true.<br/>
       If the Token does not have a `kyc_key` set and the token flag
       `accounts_kyc_granted_by_default` is not set true, then this value MUST
       be false for all accounts subsequently associated to that token.
       <p>
       Typically a transaction to set this value to true is considered
       equivalent to asserting that the "Know Your Customer" (KYC) requirements
       have been met for this combination of account and token and the relevant
       records are available as required.
       
      bool kyc_granted = 5;
      Parameters:
      value - The kycGranted to set.
      Returns:
      This builder for chaining.
    • clearKycGranted

      public TokenRelation.Builder clearKycGranted()
       *
       A flag indicating that this token relationship has been granted KYC status.
       <p>
       If the token flag `accounts_kyc_granted_by_default` is set true, then
       this flag SHALL be set true for all accounts subsequently associated to
       that token. Otherwise this flag SHALL NOT be set until a transaction
       is submitted, and signed with the Token `kyc_key` to
       set the flag true.<br/>
       If the Token does not have a `kyc_key` set and the token flag
       `accounts_kyc_granted_by_default` is not set true, then this value MUST
       be false for all accounts subsequently associated to that token.
       <p>
       Typically a transaction to set this value to true is considered
       equivalent to asserting that the "Know Your Customer" (KYC) requirements
       have been met for this combination of account and token and the relevant
       records are available as required.
       
      bool kyc_granted = 5;
      Returns:
      This builder for chaining.
    • getAutomaticAssociation

      public boolean getAutomaticAssociation()
       *
       A flag indicating that this token relationship was created using
       automatic association.
       <p>
       If this is true then there MUST NOT exist a customer-signed transaction
       associating this account and token combination and the account
       `used_auto_associations` SHALL be incremented when this relationship
       is created.
       
      bool automatic_association = 6;
      Specified by:
      getAutomaticAssociation in interface TokenRelationOrBuilder
      Returns:
      The automaticAssociation.
    • setAutomaticAssociation

      public TokenRelation.Builder setAutomaticAssociation(boolean value)
       *
       A flag indicating that this token relationship was created using
       automatic association.
       <p>
       If this is true then there MUST NOT exist a customer-signed transaction
       associating this account and token combination and the account
       `used_auto_associations` SHALL be incremented when this relationship
       is created.
       
      bool automatic_association = 6;
      Parameters:
      value - The automaticAssociation to set.
      Returns:
      This builder for chaining.
    • clearAutomaticAssociation

      public TokenRelation.Builder clearAutomaticAssociation()
       *
       A flag indicating that this token relationship was created using
       automatic association.
       <p>
       If this is true then there MUST NOT exist a customer-signed transaction
       associating this account and token combination and the account
       `used_auto_associations` SHALL be incremented when this relationship
       is created.
       
      bool automatic_association = 6;
      Returns:
      This builder for chaining.
    • hasPreviousToken

      public boolean hasPreviousToken()
       *
       The Token ID of the previous entry in the associated Account's
       "virtual double-linked list" of token relationships.
       <p>
       This must be combined with the value of `account_id` to identify the
       actual `TokenRelation` referenced.
       
      .proto.TokenID previous_token = 7;
      Specified by:
      hasPreviousToken in interface TokenRelationOrBuilder
      Returns:
      Whether the previousToken field is set.
    • getPreviousToken

      public TokenID getPreviousToken()
       *
       The Token ID of the previous entry in the associated Account's
       "virtual double-linked list" of token relationships.
       <p>
       This must be combined with the value of `account_id` to identify the
       actual `TokenRelation` referenced.
       
      .proto.TokenID previous_token = 7;
      Specified by:
      getPreviousToken in interface TokenRelationOrBuilder
      Returns:
      The previousToken.
    • setPreviousToken

      public TokenRelation.Builder setPreviousToken(TokenID value)
       *
       The Token ID of the previous entry in the associated Account's
       "virtual double-linked list" of token relationships.
       <p>
       This must be combined with the value of `account_id` to identify the
       actual `TokenRelation` referenced.
       
      .proto.TokenID previous_token = 7;
    • setPreviousToken

      public TokenRelation.Builder setPreviousToken(TokenID.Builder builderForValue)
       *
       The Token ID of the previous entry in the associated Account's
       "virtual double-linked list" of token relationships.
       <p>
       This must be combined with the value of `account_id` to identify the
       actual `TokenRelation` referenced.
       
      .proto.TokenID previous_token = 7;
    • mergePreviousToken

      public TokenRelation.Builder mergePreviousToken(TokenID value)
       *
       The Token ID of the previous entry in the associated Account's
       "virtual double-linked list" of token relationships.
       <p>
       This must be combined with the value of `account_id` to identify the
       actual `TokenRelation` referenced.
       
      .proto.TokenID previous_token = 7;
    • clearPreviousToken

      public TokenRelation.Builder clearPreviousToken()
       *
       The Token ID of the previous entry in the associated Account's
       "virtual double-linked list" of token relationships.
       <p>
       This must be combined with the value of `account_id` to identify the
       actual `TokenRelation` referenced.
       
      .proto.TokenID previous_token = 7;
    • hasNextToken

      public boolean hasNextToken()
       *
       The Token ID of the next entry in the associated Account's "virtual
       double-linked list" of token relationships.
       <p>
       This must be combined with the value of `account_id` to identify the
       actual `TokenRelation` referenced.
       
      .proto.TokenID next_token = 8;
      Specified by:
      hasNextToken in interface TokenRelationOrBuilder
      Returns:
      Whether the nextToken field is set.
    • getNextToken

      public TokenID getNextToken()
       *
       The Token ID of the next entry in the associated Account's "virtual
       double-linked list" of token relationships.
       <p>
       This must be combined with the value of `account_id` to identify the
       actual `TokenRelation` referenced.
       
      .proto.TokenID next_token = 8;
      Specified by:
      getNextToken in interface TokenRelationOrBuilder
      Returns:
      The nextToken.
    • setNextToken

      public TokenRelation.Builder setNextToken(TokenID value)
       *
       The Token ID of the next entry in the associated Account's "virtual
       double-linked list" of token relationships.
       <p>
       This must be combined with the value of `account_id` to identify the
       actual `TokenRelation` referenced.
       
      .proto.TokenID next_token = 8;
    • setNextToken

      public TokenRelation.Builder setNextToken(TokenID.Builder builderForValue)
       *
       The Token ID of the next entry in the associated Account's "virtual
       double-linked list" of token relationships.
       <p>
       This must be combined with the value of `account_id` to identify the
       actual `TokenRelation` referenced.
       
      .proto.TokenID next_token = 8;
    • mergeNextToken

      public TokenRelation.Builder mergeNextToken(TokenID value)
       *
       The Token ID of the next entry in the associated Account's "virtual
       double-linked list" of token relationships.
       <p>
       This must be combined with the value of `account_id` to identify the
       actual `TokenRelation` referenced.
       
      .proto.TokenID next_token = 8;
    • clearNextToken

      public TokenRelation.Builder clearNextToken()
       *
       The Token ID of the next entry in the associated Account's "virtual
       double-linked list" of token relationships.
       <p>
       This must be combined with the value of `account_id` to identify the
       actual `TokenRelation` referenced.
       
      .proto.TokenID next_token = 8;