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-
Field Summary
Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder
instance -
Method Summary
Modifier and TypeMethodDescription* An account identifier.* A flag indicating that this token relationship was created using automatic association.* The fungible token balance of this token relationship.* A flag indicating that this token relationship is frozen.* A flag indicating that this token relationship has been granted KYC status.* The Token ID of the next entry in the associated Account's "virtual double-linked list" of token relationships.* The Token ID of the previous entry in the associated Account's "virtual double-linked list" of token relationships.* A token identifier.* An account identifier.boolean* A flag indicating that this token relationship was created using automatic association.long* The fungible token balance of this token relationship.boolean* A flag indicating that this token relationship is frozen.boolean* A flag indicating that this token relationship has been granted KYC status.* The Token ID of the next entry in the associated Account's "virtual double-linked list" of token relationships.* The Token ID of the previous entry in the associated Account's "virtual double-linked list" of token relationships.* A token identifier.boolean* An account identifier.boolean* The Token ID of the next entry in the associated Account's "virtual double-linked list" of token relationships.boolean* The Token ID of the previous entry in the associated Account's "virtual double-linked list" of token relationships.boolean* A token identifier.mergeAccountId(AccountID value) * An account identifier.mergeNextToken(TokenID value) * The Token ID of the next entry in the associated Account's "virtual double-linked list" of token relationships.mergePreviousToken(TokenID value) * The Token ID of the previous entry in the associated Account's "virtual double-linked list" of token relationships.mergeTokenId(TokenID value) * A token identifier.setAccountId(AccountID value) * An account identifier.setAccountId(AccountID.Builder builderForValue) * An account identifier.setAutomaticAssociation(boolean value) * A flag indicating that this token relationship was created using automatic association.setBalance(long value) * The fungible token balance of this token relationship.setFrozen(boolean value) * A flag indicating that this token relationship is frozen.setKycGranted(boolean value) * A flag indicating that this token relationship has been granted KYC status.setNextToken(TokenID value) * The Token ID of the next entry in the associated Account's "virtual double-linked list" of token relationships.setNextToken(TokenID.Builder builderForValue) * The Token ID of the next entry in the associated Account's "virtual double-linked list" of token relationships.setPreviousToken(TokenID value) * The Token ID of the previous entry in the associated Account's "virtual double-linked list" of token relationships.setPreviousToken(TokenID.Builder builderForValue) * The Token ID of the previous entry in the associated Account's "virtual double-linked list" of token relationships.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 SHALL identify the token involved in this association.
.proto.TokenID token_id = 1;- Specified by:
hasTokenIdin interfaceTokenRelationOrBuilder- Returns:
- Whether the tokenId field is set.
-
getTokenId
* A token identifier. <p> This SHALL identify the token involved in this association.
.proto.TokenID token_id = 1;- Specified by:
getTokenIdin interfaceTokenRelationOrBuilder- Returns:
- The tokenId.
-
setTokenId
* A token identifier. <p> This SHALL identify the token involved in this association.
.proto.TokenID token_id = 1; -
setTokenId
* A token identifier. <p> This SHALL identify the token involved in this association.
.proto.TokenID token_id = 1; -
mergeTokenId
* A token identifier. <p> This SHALL identify the token involved in this association.
.proto.TokenID token_id = 1; -
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:
hasAccountIdin interfaceTokenRelationOrBuilder- Returns:
- Whether the accountId field is set.
-
getAccountId
* An account identifier. <p> This SHALL identify the account involved in this association.
.proto.AccountID account_id = 2;- Specified by:
getAccountIdin interfaceTokenRelationOrBuilder- Returns:
- The accountId.
-
setAccountId
* An account identifier. <p> This SHALL identify the account involved in this association.
.proto.AccountID account_id = 2; -
setAccountId
* An account identifier. <p> This SHALL identify the account involved in this association.
.proto.AccountID account_id = 2; -
mergeAccountId
* An account identifier. <p> This SHALL identify the account involved in this association.
.proto.AccountID account_id = 2; -
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:
getBalancein interfaceTokenRelationOrBuilder- Returns:
- The balance.
-
setBalance
* 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
* 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:
getFrozenin interfaceTokenRelationOrBuilder- Returns:
- The frozen.
-
setFrozen
* 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
* 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:
getKycGrantedin interfaceTokenRelationOrBuilder- Returns:
- The kycGranted.
-
setKycGranted
* 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
* 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:
getAutomaticAssociationin interfaceTokenRelationOrBuilder- Returns:
- The automaticAssociation.
-
setAutomaticAssociation
* 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
* 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:
hasPreviousTokenin interfaceTokenRelationOrBuilder- Returns:
- Whether the previousToken field is set.
-
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:
getPreviousTokenin interfaceTokenRelationOrBuilder- Returns:
- The previousToken.
-
setPreviousToken
* 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
* 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
* 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
* 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:
hasNextTokenin interfaceTokenRelationOrBuilder- Returns:
- Whether the nextToken field is set.
-
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:
getNextTokenin interfaceTokenRelationOrBuilder- Returns:
- The nextToken.
-
setNextToken
* 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
* 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
* 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
* 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;
-