Class TokenRelation

java.lang.Object
com.google.protobuf.AbstractMessageLite<TokenRelation,TokenRelation.Builder>
com.google.protobuf.GeneratedMessageLite<TokenRelation,TokenRelation.Builder>
com.hedera.hashgraph.sdk.proto.TokenRelation
All Implemented Interfaces:
com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, TokenRelationOrBuilder

@Generated public final class TokenRelation extends com.google.protobuf.GeneratedMessageLite<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
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    * An Hedera Token Service token relationship.

    Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageLite

    com.google.protobuf.GeneratedMessageLite.DefaultInstanceBasedParser<T extends com.google.protobuf.GeneratedMessageLite<T,?>>, com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageLite.GeneratedExtension<ContainingType extends com.google.protobuf.MessageLite,Type>, com.google.protobuf.GeneratedMessageLite.MethodToInvoke, com.google.protobuf.GeneratedMessageLite.SerializedForm

    Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite

    com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     

    Fields inherited from class com.google.protobuf.GeneratedMessageLite

    unknownFields

    Fields inherited from class com.google.protobuf.AbstractMessageLite

    memoizedHashCode
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final Object
    dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)
     
    * 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.
     
     
     
    parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    parseFrom(byte[] data)
     
    parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    parseFrom(com.google.protobuf.ByteString data)
     
    parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    parseFrom(com.google.protobuf.CodedInputStream input)
     
    parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
     
    parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
     
    parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static com.google.protobuf.Parser<TokenRelation>
     

    Methods inherited from class com.google.protobuf.GeneratedMessageLite

    createBuilder, createBuilder, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, emptyProtobufList, equals, getDefaultInstanceForType, getParserForType, getSerializedSize, hashCode, isInitialized, makeImmutable, mergeLengthDelimitedField, mergeUnknownFields, mergeVarintField, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBuilderForType, newMessageInfo, newRepeatedGeneratedExtension, newSingularGeneratedExtension, parseDelimitedFrom, parseDelimitedFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parsePartialFrom, parseUnknownField, registerDefaultInstance, toBuilder, toString, writeTo

    Methods inherited from class com.google.protobuf.AbstractMessageLite

    addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder

    getDefaultInstanceForType, isInitialized
  • Field Details

    • TOKEN_ID_FIELD_NUMBER

      public static final int TOKEN_ID_FIELD_NUMBER
      See Also:
    • ACCOUNT_ID_FIELD_NUMBER

      public static final int ACCOUNT_ID_FIELD_NUMBER
      See Also:
    • BALANCE_FIELD_NUMBER

      public static final int BALANCE_FIELD_NUMBER
      See Also:
    • FROZEN_FIELD_NUMBER

      public static final int FROZEN_FIELD_NUMBER
      See Also:
    • KYC_GRANTED_FIELD_NUMBER

      public static final int KYC_GRANTED_FIELD_NUMBER
      See Also:
    • AUTOMATIC_ASSOCIATION_FIELD_NUMBER

      public static final int AUTOMATIC_ASSOCIATION_FIELD_NUMBER
      See Also:
    • PREVIOUS_TOKEN_FIELD_NUMBER

      public static final int PREVIOUS_TOKEN_FIELD_NUMBER
      See Also:
    • NEXT_TOKEN_FIELD_NUMBER

      public static final int NEXT_TOKEN_FIELD_NUMBER
      See Also:
  • 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:
      hasTokenId in interface TokenRelationOrBuilder
      Returns:
      Whether the tokenId field is set.
    • getTokenId

      public TokenID getTokenId()
       *
       A token identifier.
       <p>
       This SHALL identify the token involved in this association.
       
      .proto.TokenID token_id = 1;
      Specified by:
      getTokenId in interface TokenRelationOrBuilder
      Returns:
      The tokenId.
    • hasAccountId

      public boolean hasAccountId()
       *
       An account identifier.
       <p>
       This SHALL identify the account involved in this association.
       
      .proto.AccountID account_id = 2;
      Specified by:
      hasAccountId in interface TokenRelationOrBuilder
      Returns:
      Whether the accountId field is set.
    • getAccountId

      public AccountID getAccountId()
       *
       An account identifier.
       <p>
       This SHALL identify the account involved in this association.
       
      .proto.AccountID account_id = 2;
      Specified by:
      getAccountId in interface TokenRelationOrBuilder
      Returns:
      The accountId.
    • getBalance

      public long getBalance()
       *
       The fungible token balance of this token relationship.
       <p>
       This MUST be a whole number.
       
      int64 balance = 3;
      Specified by:
      getBalance in interface TokenRelationOrBuilder
      Returns:
      The balance.
    • 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:
      getFrozen in interface TokenRelationOrBuilder
      Returns:
      The frozen.
    • 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:
      getKycGranted in interface TokenRelationOrBuilder
      Returns:
      The kycGranted.
    • 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:
      getAutomaticAssociation in interface TokenRelationOrBuilder
      Returns:
      The automaticAssociation.
    • 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:
      hasPreviousToken in interface TokenRelationOrBuilder
      Returns:
      Whether the previousToken field is set.
    • getPreviousToken

      public TokenID 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:
      getPreviousToken in interface TokenRelationOrBuilder
      Returns:
      The previousToken.
    • 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:
      hasNextToken in interface TokenRelationOrBuilder
      Returns:
      Whether the nextToken field is set.
    • getNextToken

      public TokenID 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:
      getNextToken in interface TokenRelationOrBuilder
      Returns:
      The nextToken.
    • parseFrom

      public static TokenRelation parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static TokenRelation parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static TokenRelation parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static TokenRelation parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static TokenRelation parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static TokenRelation parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static TokenRelation parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static TokenRelation parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static TokenRelation parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static TokenRelation parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static TokenRelation parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static TokenRelation parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilder

      public static TokenRelation.Builder newBuilder()
    • newBuilder

      public static TokenRelation.Builder newBuilder(TokenRelation prototype)
    • dynamicMethod

      protected final Object dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)
      Specified by:
      dynamicMethod in class com.google.protobuf.GeneratedMessageLite<TokenRelation,TokenRelation.Builder>
    • getDefaultInstance

      public static TokenRelation getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<TokenRelation> parser()