Class TokenBalance.Builder

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

public static final class TokenBalance.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<TokenBalance,TokenBalance.Builder> implements TokenBalanceOrBuilder
 *
 A number of _transferable units_ of a specified token.

 The transferable unit of a token is its smallest denomination, as given by
 the token's `decimals` property. Each minted token contains
 10<sup>`decimals`</sup> transferable units. For example, we could think of
 the cent as the transferable unit of the US dollar (`decimals=2`); and the
 tinybar as the transferable unit of HBAR (`decimals=8`).

 Transferable units are not directly comparable across different tokens.
 
Protobuf type proto.TokenBalance
  • Method Details

    • hasTokenId

      public boolean hasTokenId()
       *
       A token identifier.
       
      .proto.TokenID tokenId = 1;
      Specified by:
      hasTokenId in interface TokenBalanceOrBuilder
      Returns:
      Whether the tokenId field is set.
    • getTokenId

      public TokenID getTokenId()
       *
       A token identifier.
       
      .proto.TokenID tokenId = 1;
      Specified by:
      getTokenId in interface TokenBalanceOrBuilder
      Returns:
      The tokenId.
    • setTokenId

      public TokenBalance.Builder setTokenId(TokenID value)
       *
       A token identifier.
       
      .proto.TokenID tokenId = 1;
    • setTokenId

      public TokenBalance.Builder setTokenId(TokenID.Builder builderForValue)
       *
       A token identifier.
       
      .proto.TokenID tokenId = 1;
    • mergeTokenId

      public TokenBalance.Builder mergeTokenId(TokenID value)
       *
       A token identifier.
       
      .proto.TokenID tokenId = 1;
    • clearTokenId

      public TokenBalance.Builder clearTokenId()
       *
       A token identifier.
       
      .proto.TokenID tokenId = 1;
    • getBalance

      public long getBalance()
       *
       A number of transferable units of the identified token.
       <p>
       For fungible/common tokens this SHALL be the balance, in units of
       10<sup>`-decimals`</sup> whole tokens.<br/>
       For non-fungible/unique tokens, this SHALL be the number of
       individual unique tokens in this balance.
       
      uint64 balance = 2;
      Specified by:
      getBalance in interface TokenBalanceOrBuilder
      Returns:
      The balance.
    • setBalance

      public TokenBalance.Builder setBalance(long value)
       *
       A number of transferable units of the identified token.
       <p>
       For fungible/common tokens this SHALL be the balance, in units of
       10<sup>`-decimals`</sup> whole tokens.<br/>
       For non-fungible/unique tokens, this SHALL be the number of
       individual unique tokens in this balance.
       
      uint64 balance = 2;
      Parameters:
      value - The balance to set.
      Returns:
      This builder for chaining.
    • clearBalance

      public TokenBalance.Builder clearBalance()
       *
       A number of transferable units of the identified token.
       <p>
       For fungible/common tokens this SHALL be the balance, in units of
       10<sup>`-decimals`</sup> whole tokens.<br/>
       For non-fungible/unique tokens, this SHALL be the number of
       individual unique tokens in this balance.
       
      uint64 balance = 2;
      Returns:
      This builder for chaining.
    • getDecimals

      public int getDecimals()
       *
       A number of "decimals" precision.
       <p>
       This MUST match the `decimals` value for the token identified by the
       `tokenId` field.
       
      uint32 decimals = 3;
      Specified by:
      getDecimals in interface TokenBalanceOrBuilder
      Returns:
      The decimals.
    • setDecimals

      public TokenBalance.Builder setDecimals(int value)
       *
       A number of "decimals" precision.
       <p>
       This MUST match the `decimals` value for the token identified by the
       `tokenId` field.
       
      uint32 decimals = 3;
      Parameters:
      value - The decimals to set.
      Returns:
      This builder for chaining.
    • clearDecimals

      public TokenBalance.Builder clearDecimals()
       *
       A number of "decimals" precision.
       <p>
       This MUST match the `decimals` value for the token identified by the
       `tokenId` field.
       
      uint32 decimals = 3;
      Returns:
      This builder for chaining.