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-
Field Summary
Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder
instance -
Method Summary
Modifier and TypeMethodDescription* A number of transferable units of the identified token.* A number of "decimals" precision.* A token identifier.long* A number of transferable units of the identified token.int* A number of "decimals" precision.* A token identifier.boolean* A token identifier.mergeTokenId(TokenID value) * A token identifier.setBalance(long value) * A number of transferable units of the identified token.setDecimals(int value) * A number of "decimals" precision.setTokenId(TokenID value) * A token identifier.setTokenId(TokenID.Builder builderForValue) * A token identifier.Methods inherited from class com.google.protobuf.GeneratedMessageLite.Builder
build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFromMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType, isInitialized
-
Method Details
-
hasTokenId
public boolean hasTokenId()* A token identifier.
.proto.TokenID tokenId = 1;- Specified by:
hasTokenIdin interfaceTokenBalanceOrBuilder- Returns:
- Whether the tokenId field is set.
-
getTokenId
* A token identifier.
.proto.TokenID tokenId = 1;- Specified by:
getTokenIdin interfaceTokenBalanceOrBuilder- Returns:
- The tokenId.
-
setTokenId
* A token identifier.
.proto.TokenID tokenId = 1; -
setTokenId
* A token identifier.
.proto.TokenID tokenId = 1; -
mergeTokenId
* A token identifier.
.proto.TokenID tokenId = 1; -
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:
getBalancein interfaceTokenBalanceOrBuilder- Returns:
- The balance.
-
setBalance
* 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
* 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:
getDecimalsin interfaceTokenBalanceOrBuilder- Returns:
- The decimals.
-
setDecimals
* 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
* 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.
-