Class TokenRelationship.Builder

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

public static final class TokenRelationship.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<TokenRelationship,TokenRelationship.Builder> implements TokenRelationshipOrBuilder
 *
 An Hedera Token Service token relationship. A token relationship describes
 the connection between an Account and a Token type, including the current
 account balance in that token.

 A `TokenRelationship` SHALL contain, for the designated token and enclosing
 account, The account's current balance, whether the account has KYC granted,
 whether the assets are frozen and whether the association was automatic.<br/>
 A `TokenRelationship` MAY also contain the `symbol` and `decimals` values
 copied from the token.<br/>
 `TokenRelationship` entries SHALL be valid only within the context of a
 `GetAccountDetails` query response, or other enclosing message, which
 specifies the account side of the relationship.
 
Protobuf type proto.TokenRelationship
  • Method Details

    • hasTokenId

      public boolean hasTokenId()
       *
       A token identifier.
       <p>
       This MUST match an existing token that is not deleted.
       
      .proto.TokenID tokenId = 1;
      Specified by:
      hasTokenId in interface TokenRelationshipOrBuilder
      Returns:
      Whether the tokenId field is set.
    • getTokenId

      public TokenID getTokenId()
       *
       A token identifier.
       <p>
       This MUST match an existing token that is not deleted.
       
      .proto.TokenID tokenId = 1;
      Specified by:
      getTokenId in interface TokenRelationshipOrBuilder
      Returns:
      The tokenId.
    • setTokenId

      public TokenRelationship.Builder setTokenId(TokenID value)
       *
       A token identifier.
       <p>
       This MUST match an existing token that is not deleted.
       
      .proto.TokenID tokenId = 1;
    • setTokenId

      public TokenRelationship.Builder setTokenId(TokenID.Builder builderForValue)
       *
       A token identifier.
       <p>
       This MUST match an existing token that is not deleted.
       
      .proto.TokenID tokenId = 1;
    • mergeTokenId

      public TokenRelationship.Builder mergeTokenId(TokenID value)
       *
       A token identifier.
       <p>
       This MUST match an existing token that is not deleted.
       
      .proto.TokenID tokenId = 1;
    • clearTokenId

      public TokenRelationship.Builder clearTokenId()
       *
       A token identifier.
       <p>
       This MUST match an existing token that is not deleted.
       
      .proto.TokenID tokenId = 1;
    • getSymbol

      public String getSymbol()
       *
       A token symbol.
       <p>
       This MUST match an existing token that is not deleted.<br/>
       This MUST match the value for the token identified in `tokenId`.
       
      string symbol = 2;
      Specified by:
      getSymbol in interface TokenRelationshipOrBuilder
      Returns:
      The symbol.
    • getSymbolBytes

      public com.google.protobuf.ByteString getSymbolBytes()
       *
       A token symbol.
       <p>
       This MUST match an existing token that is not deleted.<br/>
       This MUST match the value for the token identified in `tokenId`.
       
      string symbol = 2;
      Specified by:
      getSymbolBytes in interface TokenRelationshipOrBuilder
      Returns:
      The bytes for symbol.
    • setSymbol

      public TokenRelationship.Builder setSymbol(String value)
       *
       A token symbol.
       <p>
       This MUST match an existing token that is not deleted.<br/>
       This MUST match the value for the token identified in `tokenId`.
       
      string symbol = 2;
      Parameters:
      value - The symbol to set.
      Returns:
      This builder for chaining.
    • clearSymbol

      public TokenRelationship.Builder clearSymbol()
       *
       A token symbol.
       <p>
       This MUST match an existing token that is not deleted.<br/>
       This MUST match the value for the token identified in `tokenId`.
       
      string symbol = 2;
      Returns:
      This builder for chaining.
    • setSymbolBytes

      public TokenRelationship.Builder setSymbolBytes(com.google.protobuf.ByteString value)
       *
       A token symbol.
       <p>
       This MUST match an existing token that is not deleted.<br/>
       This MUST match the value for the token identified in `tokenId`.
       
      string symbol = 2;
      Parameters:
      value - The bytes for symbol to set.
      Returns:
      This builder for chaining.
    • getBalance

      public long getBalance()
       *
       An account balance for this token.
       <p>
       For fungible/common tokens this SHALL be the balance that the
       account holds of that token. The value is provided as an integer amount
       of the smallest unit of the token (i.e. 10<sup>`-decimals`</sup> whole
       tokens).<br/>
       For non-fungible/unique tokens this SHALL be the whole number of
       unique tokens held by the account for this token type.
       
      uint64 balance = 3;
      Specified by:
      getBalance in interface TokenRelationshipOrBuilder
      Returns:
      The balance.
    • setBalance

      public TokenRelationship.Builder setBalance(long value)
       *
       An account balance for this token.
       <p>
       For fungible/common tokens this SHALL be the balance that the
       account holds of that token. The value is provided as an integer amount
       of the smallest unit of the token (i.e. 10<sup>`-decimals`</sup> whole
       tokens).<br/>
       For non-fungible/unique tokens this SHALL be the whole number of
       unique tokens held by the account for this token type.
       
      uint64 balance = 3;
      Parameters:
      value - The balance to set.
      Returns:
      This builder for chaining.
    • clearBalance

      public TokenRelationship.Builder clearBalance()
       *
       An account balance for this token.
       <p>
       For fungible/common tokens this SHALL be the balance that the
       account holds of that token. The value is provided as an integer amount
       of the smallest unit of the token (i.e. 10<sup>`-decimals`</sup> whole
       tokens).<br/>
       For non-fungible/unique tokens this SHALL be the whole number of
       unique tokens held by the account for this token type.
       
      uint64 balance = 3;
      Returns:
      This builder for chaining.
    • getKycStatusValue

      public int getKycStatusValue()
       *
       A KYC status for the account with respect to this token.
       <p>
       This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is
       not supported for this token (e.g. the `kyc_key` of the token is not
       set), this SHALL be `KycNotApplicable`.
       
      .proto.TokenKycStatus kycStatus = 4;
      Specified by:
      getKycStatusValue in interface TokenRelationshipOrBuilder
      Returns:
      The enum numeric value on the wire for kycStatus.
    • setKycStatusValue

      public TokenRelationship.Builder setKycStatusValue(int value)
       *
       A KYC status for the account with respect to this token.
       <p>
       This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is
       not supported for this token (e.g. the `kyc_key` of the token is not
       set), this SHALL be `KycNotApplicable`.
       
      .proto.TokenKycStatus kycStatus = 4;
      Parameters:
      value - The kycStatus to set.
      Returns:
      This builder for chaining.
      Throws:
      IllegalArgumentException - if UNRECOGNIZED is provided.
    • getKycStatus

      public TokenKycStatus getKycStatus()
       *
       A KYC status for the account with respect to this token.
       <p>
       This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is
       not supported for this token (e.g. the `kyc_key` of the token is not
       set), this SHALL be `KycNotApplicable`.
       
      .proto.TokenKycStatus kycStatus = 4;
      Specified by:
      getKycStatus in interface TokenRelationshipOrBuilder
      Returns:
      The kycStatus.
    • setKycStatus

      public TokenRelationship.Builder setKycStatus(TokenKycStatus value)
       *
       A KYC status for the account with respect to this token.
       <p>
       This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is
       not supported for this token (e.g. the `kyc_key` of the token is not
       set), this SHALL be `KycNotApplicable`.
       
      .proto.TokenKycStatus kycStatus = 4;
      Parameters:
      value - The enum numeric value on the wire for kycStatus to set.
      Returns:
      This builder for chaining.
    • clearKycStatus

      public TokenRelationship.Builder clearKycStatus()
       *
       A KYC status for the account with respect to this token.
       <p>
       This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is
       not supported for this token (e.g. the `kyc_key` of the token is not
       set), this SHALL be `KycNotApplicable`.
       
      .proto.TokenKycStatus kycStatus = 4;
      Returns:
      This builder for chaining.
    • getFreezeStatusValue

      public int getFreezeStatusValue()
       *
       A Freeze status for the account with respect to this token.
       <p>
       This value SHALL be one of `FreezeNotApplicable`, `Frozen`
       or `Unfrozen`.<br/>
       If the token cannot freeze account assets (e.g. the `freeze_key` of the
       token is not set), this SHALL be `FreezeNotApplicable`.
       
      .proto.TokenFreezeStatus freezeStatus = 5;
      Specified by:
      getFreezeStatusValue in interface TokenRelationshipOrBuilder
      Returns:
      The enum numeric value on the wire for freezeStatus.
    • setFreezeStatusValue

      public TokenRelationship.Builder setFreezeStatusValue(int value)
       *
       A Freeze status for the account with respect to this token.
       <p>
       This value SHALL be one of `FreezeNotApplicable`, `Frozen`
       or `Unfrozen`.<br/>
       If the token cannot freeze account assets (e.g. the `freeze_key` of the
       token is not set), this SHALL be `FreezeNotApplicable`.
       
      .proto.TokenFreezeStatus freezeStatus = 5;
      Parameters:
      value - The freezeStatus to set.
      Returns:
      This builder for chaining.
      Throws:
      IllegalArgumentException - if UNRECOGNIZED is provided.
    • getFreezeStatus

      public TokenFreezeStatus getFreezeStatus()
       *
       A Freeze status for the account with respect to this token.
       <p>
       This value SHALL be one of `FreezeNotApplicable`, `Frozen`
       or `Unfrozen`.<br/>
       If the token cannot freeze account assets (e.g. the `freeze_key` of the
       token is not set), this SHALL be `FreezeNotApplicable`.
       
      .proto.TokenFreezeStatus freezeStatus = 5;
      Specified by:
      getFreezeStatus in interface TokenRelationshipOrBuilder
      Returns:
      The freezeStatus.
    • setFreezeStatus

      public TokenRelationship.Builder setFreezeStatus(TokenFreezeStatus value)
       *
       A Freeze status for the account with respect to this token.
       <p>
       This value SHALL be one of `FreezeNotApplicable`, `Frozen`
       or `Unfrozen`.<br/>
       If the token cannot freeze account assets (e.g. the `freeze_key` of the
       token is not set), this SHALL be `FreezeNotApplicable`.
       
      .proto.TokenFreezeStatus freezeStatus = 5;
      Parameters:
      value - The enum numeric value on the wire for freezeStatus to set.
      Returns:
      This builder for chaining.
    • clearFreezeStatus

      public TokenRelationship.Builder clearFreezeStatus()
       *
       A Freeze status for the account with respect to this token.
       <p>
       This value SHALL be one of `FreezeNotApplicable`, `Frozen`
       or `Unfrozen`.<br/>
       If the token cannot freeze account assets (e.g. the `freeze_key` of the
       token is not set), this SHALL be `FreezeNotApplicable`.
       
      .proto.TokenFreezeStatus freezeStatus = 5;
      Returns:
      This builder for chaining.
    • getDecimals

      public int getDecimals()
       *
       A maximum "precision" for this token.
       <p>
       This value MUST match the `decimals` field of the token identified in
       the `tokenId` field.<br/>
       A single whole token SHALL be divided into at most
       10<sup>`decimals`</sup> sub-units.
       
      uint32 decimals = 6;
      Specified by:
      getDecimals in interface TokenRelationshipOrBuilder
      Returns:
      The decimals.
    • setDecimals

      public TokenRelationship.Builder setDecimals(int value)
       *
       A maximum "precision" for this token.
       <p>
       This value MUST match the `decimals` field of the token identified in
       the `tokenId` field.<br/>
       A single whole token SHALL be divided into at most
       10<sup>`decimals`</sup> sub-units.
       
      uint32 decimals = 6;
      Parameters:
      value - The decimals to set.
      Returns:
      This builder for chaining.
    • clearDecimals

      public TokenRelationship.Builder clearDecimals()
       *
       A maximum "precision" for this token.
       <p>
       This value MUST match the `decimals` field of the token identified in
       the `tokenId` field.<br/>
       A single whole token SHALL be divided into at most
       10<sup>`decimals`</sup> sub-units.
       
      uint32 decimals = 6;
      Returns:
      This builder for chaining.
    • getAutomaticAssociation

      public boolean getAutomaticAssociation()
       *
       An automatic association flag.
       <p>
       This SHALL be set if the relationship was created implicitly
       (automatically).<br/>
       This SHALL be unset if the relationship was created explicitly
       (manually) via a `TokenAssociate` transaction.
       
      bool automatic_association = 7;
      Specified by:
      getAutomaticAssociation in interface TokenRelationshipOrBuilder
      Returns:
      The automaticAssociation.
    • setAutomaticAssociation

      public TokenRelationship.Builder setAutomaticAssociation(boolean value)
       *
       An automatic association flag.
       <p>
       This SHALL be set if the relationship was created implicitly
       (automatically).<br/>
       This SHALL be unset if the relationship was created explicitly
       (manually) via a `TokenAssociate` transaction.
       
      bool automatic_association = 7;
      Parameters:
      value - The automaticAssociation to set.
      Returns:
      This builder for chaining.
    • clearAutomaticAssociation

      public TokenRelationship.Builder clearAutomaticAssociation()
       *
       An automatic association flag.
       <p>
       This SHALL be set if the relationship was created implicitly
       (automatically).<br/>
       This SHALL be unset if the relationship was created explicitly
       (manually) via a `TokenAssociate` transaction.
       
      bool automatic_association = 7;
      Returns:
      This builder for chaining.