Module com.hedera.hashgraph.sdk
Package com.hedera.hashgraph.sdk.proto
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-
Field Summary
Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder
instance -
Method Summary
Modifier and TypeMethodDescription* An automatic association flag.* An account balance for this token.* A maximum "precision" for this token.* A Freeze status for the account with respect to this token.* A KYC status for the account with respect to this token.* A token symbol.* A token identifier.boolean* An automatic association flag.long* An account balance for this token.int* A maximum "precision" for this token.* A Freeze status for the account with respect to this token.int* A Freeze status for the account with respect to this token.* A KYC status for the account with respect to this token.int* A KYC status for the account with respect to this token.* A token symbol.com.google.protobuf.ByteString* A token symbol.* A token identifier.boolean* A token identifier.mergeTokenId(TokenID value) * A token identifier.setAutomaticAssociation(boolean value) * An automatic association flag.setBalance(long value) * An account balance for this token.setDecimals(int value) * A maximum "precision" for this token.setFreezeStatus(TokenFreezeStatus value) * A Freeze status for the account with respect to this token.setFreezeStatusValue(int value) * A Freeze status for the account with respect to this token.setKycStatus(TokenKycStatus value) * A KYC status for the account with respect to this token.setKycStatusValue(int value) * A KYC status for the account with respect to this token.* A token symbol.setSymbolBytes(com.google.protobuf.ByteString value) * A token symbol.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. <p> This MUST match an existing token that is not deleted.
.proto.TokenID tokenId = 1;- Specified by:
hasTokenIdin interfaceTokenRelationshipOrBuilder- Returns:
- Whether the tokenId field is set.
-
getTokenId
* A token identifier. <p> This MUST match an existing token that is not deleted.
.proto.TokenID tokenId = 1;- Specified by:
getTokenIdin interfaceTokenRelationshipOrBuilder- Returns:
- The tokenId.
-
setTokenId
* A token identifier. <p> This MUST match an existing token that is not deleted.
.proto.TokenID tokenId = 1; -
setTokenId
* A token identifier. <p> This MUST match an existing token that is not deleted.
.proto.TokenID tokenId = 1; -
mergeTokenId
* A token identifier. <p> This MUST match an existing token that is not deleted.
.proto.TokenID tokenId = 1; -
clearTokenId
* A token identifier. <p> This MUST match an existing token that is not deleted.
.proto.TokenID tokenId = 1; -
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:
getSymbolin interfaceTokenRelationshipOrBuilder- 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:
getSymbolBytesin interfaceTokenRelationshipOrBuilder- Returns:
- The bytes for symbol.
-
setSymbol
* 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
* 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
* 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:
getBalancein interfaceTokenRelationshipOrBuilder- Returns:
- The balance.
-
setBalance
* 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
* 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:
getKycStatusValuein interfaceTokenRelationshipOrBuilder- Returns:
- The enum numeric value on the wire for kycStatus.
-
setKycStatusValue
* 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
* 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:
getKycStatusin interfaceTokenRelationshipOrBuilder- Returns:
- The kycStatus.
-
setKycStatus
* 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
* 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:
getFreezeStatusValuein interfaceTokenRelationshipOrBuilder- Returns:
- The enum numeric value on the wire for freezeStatus.
-
setFreezeStatusValue
* 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
* 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:
getFreezeStatusin interfaceTokenRelationshipOrBuilder- Returns:
- The freezeStatus.
-
setFreezeStatus
* 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
* 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:
getDecimalsin interfaceTokenRelationshipOrBuilder- Returns:
- The decimals.
-
setDecimals
* 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
* 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:
getAutomaticAssociationin interfaceTokenRelationshipOrBuilder- Returns:
- The automaticAssociation.
-
setAutomaticAssociation
* 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
* 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.
-