Class TokenTransferList.Builder

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

public static final class TokenTransferList.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<TokenTransferList,TokenTransferList.Builder> implements TokenTransferListOrBuilder
 *
 A list of transfers for a particular (non-HBAR) token type.

 A `TokenTransferList` applies to a single token type, but may contain many
 individual transfers.<br/>
 Each transfer of a fungible/common token MUST specify an `accountID` and
 `amount`. Amount SHALL be positive when the account receives tokens, and
 SHALL be negative when the account sends tokens. The amount SHOULD NOT be
 `0`.<br/>
 In a transfer list containing fungible/common tokens in the `transfers`
 list, the sum of all such transfers MUST be zero (`0`).
 Each transfer of a unique token SHALL specify both sender and receiver, as
 well as the serial number transferred.<br/>
 A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`,
 but MUST NOT contain both.
 
Protobuf type proto.TokenTransferList
  • Method Details

    • hasToken

      public boolean hasToken()
       *
       A token identifier.<br/>
       This is the token to be transferred.
       
      .proto.TokenID token = 1;
      Specified by:
      hasToken in interface TokenTransferListOrBuilder
      Returns:
      Whether the token field is set.
    • getToken

      public TokenID getToken()
       *
       A token identifier.<br/>
       This is the token to be transferred.
       
      .proto.TokenID token = 1;
      Specified by:
      getToken in interface TokenTransferListOrBuilder
      Returns:
      The token.
    • setToken

      public TokenTransferList.Builder setToken(TokenID value)
       *
       A token identifier.<br/>
       This is the token to be transferred.
       
      .proto.TokenID token = 1;
    • setToken

      public TokenTransferList.Builder setToken(TokenID.Builder builderForValue)
       *
       A token identifier.<br/>
       This is the token to be transferred.
       
      .proto.TokenID token = 1;
    • mergeToken

      public TokenTransferList.Builder mergeToken(TokenID value)
       *
       A token identifier.<br/>
       This is the token to be transferred.
       
      .proto.TokenID token = 1;
    • clearToken

      public TokenTransferList.Builder clearToken()
       *
       A token identifier.<br/>
       This is the token to be transferred.
       
      .proto.TokenID token = 1;
    • getTransfersList

      public List<AccountAmount> getTransfersList()
       *
       A list of account amounts.
       <p>
       Each entry SHALL have an account and amount.<br/>
       These transfers SHALL be "double-entry" style; the credits (positive
       amount) and debits (negative amount) MUST sum to 0, unless this
       transfer list is part of a `mint` or `burn` operation.<br/>
       This SHALL be be set for fungible/common tokens and MUST be
       empty otherwise.
       
      repeated .proto.AccountAmount transfers = 2;
      Specified by:
      getTransfersList in interface TokenTransferListOrBuilder
    • getTransfersCount

      public int getTransfersCount()
       *
       A list of account amounts.
       <p>
       Each entry SHALL have an account and amount.<br/>
       These transfers SHALL be "double-entry" style; the credits (positive
       amount) and debits (negative amount) MUST sum to 0, unless this
       transfer list is part of a `mint` or `burn` operation.<br/>
       This SHALL be be set for fungible/common tokens and MUST be
       empty otherwise.
       
      repeated .proto.AccountAmount transfers = 2;
      Specified by:
      getTransfersCount in interface TokenTransferListOrBuilder
    • getTransfers

      public AccountAmount getTransfers(int index)
       *
       A list of account amounts.
       <p>
       Each entry SHALL have an account and amount.<br/>
       These transfers SHALL be "double-entry" style; the credits (positive
       amount) and debits (negative amount) MUST sum to 0, unless this
       transfer list is part of a `mint` or `burn` operation.<br/>
       This SHALL be be set for fungible/common tokens and MUST be
       empty otherwise.
       
      repeated .proto.AccountAmount transfers = 2;
      Specified by:
      getTransfers in interface TokenTransferListOrBuilder
    • setTransfers

      public TokenTransferList.Builder setTransfers(int index, AccountAmount value)
       *
       A list of account amounts.
       <p>
       Each entry SHALL have an account and amount.<br/>
       These transfers SHALL be "double-entry" style; the credits (positive
       amount) and debits (negative amount) MUST sum to 0, unless this
       transfer list is part of a `mint` or `burn` operation.<br/>
       This SHALL be be set for fungible/common tokens and MUST be
       empty otherwise.
       
      repeated .proto.AccountAmount transfers = 2;
    • setTransfers

      public TokenTransferList.Builder setTransfers(int index, AccountAmount.Builder builderForValue)
       *
       A list of account amounts.
       <p>
       Each entry SHALL have an account and amount.<br/>
       These transfers SHALL be "double-entry" style; the credits (positive
       amount) and debits (negative amount) MUST sum to 0, unless this
       transfer list is part of a `mint` or `burn` operation.<br/>
       This SHALL be be set for fungible/common tokens and MUST be
       empty otherwise.
       
      repeated .proto.AccountAmount transfers = 2;
    • addTransfers

      public TokenTransferList.Builder addTransfers(AccountAmount value)
       *
       A list of account amounts.
       <p>
       Each entry SHALL have an account and amount.<br/>
       These transfers SHALL be "double-entry" style; the credits (positive
       amount) and debits (negative amount) MUST sum to 0, unless this
       transfer list is part of a `mint` or `burn` operation.<br/>
       This SHALL be be set for fungible/common tokens and MUST be
       empty otherwise.
       
      repeated .proto.AccountAmount transfers = 2;
    • addTransfers

      public TokenTransferList.Builder addTransfers(int index, AccountAmount value)
       *
       A list of account amounts.
       <p>
       Each entry SHALL have an account and amount.<br/>
       These transfers SHALL be "double-entry" style; the credits (positive
       amount) and debits (negative amount) MUST sum to 0, unless this
       transfer list is part of a `mint` or `burn` operation.<br/>
       This SHALL be be set for fungible/common tokens and MUST be
       empty otherwise.
       
      repeated .proto.AccountAmount transfers = 2;
    • addTransfers

      public TokenTransferList.Builder addTransfers(AccountAmount.Builder builderForValue)
       *
       A list of account amounts.
       <p>
       Each entry SHALL have an account and amount.<br/>
       These transfers SHALL be "double-entry" style; the credits (positive
       amount) and debits (negative amount) MUST sum to 0, unless this
       transfer list is part of a `mint` or `burn` operation.<br/>
       This SHALL be be set for fungible/common tokens and MUST be
       empty otherwise.
       
      repeated .proto.AccountAmount transfers = 2;
    • addTransfers

      public TokenTransferList.Builder addTransfers(int index, AccountAmount.Builder builderForValue)
       *
       A list of account amounts.
       <p>
       Each entry SHALL have an account and amount.<br/>
       These transfers SHALL be "double-entry" style; the credits (positive
       amount) and debits (negative amount) MUST sum to 0, unless this
       transfer list is part of a `mint` or `burn` operation.<br/>
       This SHALL be be set for fungible/common tokens and MUST be
       empty otherwise.
       
      repeated .proto.AccountAmount transfers = 2;
    • addAllTransfers

      public TokenTransferList.Builder addAllTransfers(Iterable<? extends AccountAmount> values)
       *
       A list of account amounts.
       <p>
       Each entry SHALL have an account and amount.<br/>
       These transfers SHALL be "double-entry" style; the credits (positive
       amount) and debits (negative amount) MUST sum to 0, unless this
       transfer list is part of a `mint` or `burn` operation.<br/>
       This SHALL be be set for fungible/common tokens and MUST be
       empty otherwise.
       
      repeated .proto.AccountAmount transfers = 2;
    • clearTransfers

      public TokenTransferList.Builder clearTransfers()
       *
       A list of account amounts.
       <p>
       Each entry SHALL have an account and amount.<br/>
       These transfers SHALL be "double-entry" style; the credits (positive
       amount) and debits (negative amount) MUST sum to 0, unless this
       transfer list is part of a `mint` or `burn` operation.<br/>
       This SHALL be be set for fungible/common tokens and MUST be
       empty otherwise.
       
      repeated .proto.AccountAmount transfers = 2;
    • removeTransfers

      public TokenTransferList.Builder removeTransfers(int index)
       *
       A list of account amounts.
       <p>
       Each entry SHALL have an account and amount.<br/>
       These transfers SHALL be "double-entry" style; the credits (positive
       amount) and debits (negative amount) MUST sum to 0, unless this
       transfer list is part of a `mint` or `burn` operation.<br/>
       This SHALL be be set for fungible/common tokens and MUST be
       empty otherwise.
       
      repeated .proto.AccountAmount transfers = 2;
    • getNftTransfersList

      public List<NftTransfer> getNftTransfersList()
       *
       A list of NftTransfers.
       <p>
       Each entry SHALL have a sender and receiver account, and the
       serial number of the unique token to transfer.<br/>
       This SHALL be be set for non-fungible/unique tokens and SHALL be
       empty otherwise.
       
      repeated .proto.NftTransfer nftTransfers = 3;
      Specified by:
      getNftTransfersList in interface TokenTransferListOrBuilder
    • getNftTransfersCount

      public int getNftTransfersCount()
       *
       A list of NftTransfers.
       <p>
       Each entry SHALL have a sender and receiver account, and the
       serial number of the unique token to transfer.<br/>
       This SHALL be be set for non-fungible/unique tokens and SHALL be
       empty otherwise.
       
      repeated .proto.NftTransfer nftTransfers = 3;
      Specified by:
      getNftTransfersCount in interface TokenTransferListOrBuilder
    • getNftTransfers

      public NftTransfer getNftTransfers(int index)
       *
       A list of NftTransfers.
       <p>
       Each entry SHALL have a sender and receiver account, and the
       serial number of the unique token to transfer.<br/>
       This SHALL be be set for non-fungible/unique tokens and SHALL be
       empty otherwise.
       
      repeated .proto.NftTransfer nftTransfers = 3;
      Specified by:
      getNftTransfers in interface TokenTransferListOrBuilder
    • setNftTransfers

      public TokenTransferList.Builder setNftTransfers(int index, NftTransfer value)
       *
       A list of NftTransfers.
       <p>
       Each entry SHALL have a sender and receiver account, and the
       serial number of the unique token to transfer.<br/>
       This SHALL be be set for non-fungible/unique tokens and SHALL be
       empty otherwise.
       
      repeated .proto.NftTransfer nftTransfers = 3;
    • setNftTransfers

      public TokenTransferList.Builder setNftTransfers(int index, NftTransfer.Builder builderForValue)
       *
       A list of NftTransfers.
       <p>
       Each entry SHALL have a sender and receiver account, and the
       serial number of the unique token to transfer.<br/>
       This SHALL be be set for non-fungible/unique tokens and SHALL be
       empty otherwise.
       
      repeated .proto.NftTransfer nftTransfers = 3;
    • addNftTransfers

      public TokenTransferList.Builder addNftTransfers(NftTransfer value)
       *
       A list of NftTransfers.
       <p>
       Each entry SHALL have a sender and receiver account, and the
       serial number of the unique token to transfer.<br/>
       This SHALL be be set for non-fungible/unique tokens and SHALL be
       empty otherwise.
       
      repeated .proto.NftTransfer nftTransfers = 3;
    • addNftTransfers

      public TokenTransferList.Builder addNftTransfers(int index, NftTransfer value)
       *
       A list of NftTransfers.
       <p>
       Each entry SHALL have a sender and receiver account, and the
       serial number of the unique token to transfer.<br/>
       This SHALL be be set for non-fungible/unique tokens and SHALL be
       empty otherwise.
       
      repeated .proto.NftTransfer nftTransfers = 3;
    • addNftTransfers

      public TokenTransferList.Builder addNftTransfers(NftTransfer.Builder builderForValue)
       *
       A list of NftTransfers.
       <p>
       Each entry SHALL have a sender and receiver account, and the
       serial number of the unique token to transfer.<br/>
       This SHALL be be set for non-fungible/unique tokens and SHALL be
       empty otherwise.
       
      repeated .proto.NftTransfer nftTransfers = 3;
    • addNftTransfers

      public TokenTransferList.Builder addNftTransfers(int index, NftTransfer.Builder builderForValue)
       *
       A list of NftTransfers.
       <p>
       Each entry SHALL have a sender and receiver account, and the
       serial number of the unique token to transfer.<br/>
       This SHALL be be set for non-fungible/unique tokens and SHALL be
       empty otherwise.
       
      repeated .proto.NftTransfer nftTransfers = 3;
    • addAllNftTransfers

      public TokenTransferList.Builder addAllNftTransfers(Iterable<? extends NftTransfer> values)
       *
       A list of NftTransfers.
       <p>
       Each entry SHALL have a sender and receiver account, and the
       serial number of the unique token to transfer.<br/>
       This SHALL be be set for non-fungible/unique tokens and SHALL be
       empty otherwise.
       
      repeated .proto.NftTransfer nftTransfers = 3;
    • clearNftTransfers

      public TokenTransferList.Builder clearNftTransfers()
       *
       A list of NftTransfers.
       <p>
       Each entry SHALL have a sender and receiver account, and the
       serial number of the unique token to transfer.<br/>
       This SHALL be be set for non-fungible/unique tokens and SHALL be
       empty otherwise.
       
      repeated .proto.NftTransfer nftTransfers = 3;
    • removeNftTransfers

      public TokenTransferList.Builder removeNftTransfers(int index)
       *
       A list of NftTransfers.
       <p>
       Each entry SHALL have a sender and receiver account, and the
       serial number of the unique token to transfer.<br/>
       This SHALL be be set for non-fungible/unique tokens and SHALL be
       empty otherwise.
       
      repeated .proto.NftTransfer nftTransfers = 3;
    • hasExpectedDecimals

      public boolean hasExpectedDecimals()
       *
       An expected decimal precision.<br/>
       This is the number of decimals a fungible/common token type is
       _expected_ to have.
       <p>
       The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS`
       if this is set and the actual decimals specified for the `Token` differ
       from this value.<br/>
       If `nftTransfers` is set, then this value SHOULD NOT be set.
       
      .google.protobuf.UInt32Value expected_decimals = 4;
      Specified by:
      hasExpectedDecimals in interface TokenTransferListOrBuilder
      Returns:
      Whether the expectedDecimals field is set.
    • getExpectedDecimals

      public com.google.protobuf.UInt32Value getExpectedDecimals()
       *
       An expected decimal precision.<br/>
       This is the number of decimals a fungible/common token type is
       _expected_ to have.
       <p>
       The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS`
       if this is set and the actual decimals specified for the `Token` differ
       from this value.<br/>
       If `nftTransfers` is set, then this value SHOULD NOT be set.
       
      .google.protobuf.UInt32Value expected_decimals = 4;
      Specified by:
      getExpectedDecimals in interface TokenTransferListOrBuilder
      Returns:
      The expectedDecimals.
    • setExpectedDecimals

      public TokenTransferList.Builder setExpectedDecimals(com.google.protobuf.UInt32Value value)
       *
       An expected decimal precision.<br/>
       This is the number of decimals a fungible/common token type is
       _expected_ to have.
       <p>
       The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS`
       if this is set and the actual decimals specified for the `Token` differ
       from this value.<br/>
       If `nftTransfers` is set, then this value SHOULD NOT be set.
       
      .google.protobuf.UInt32Value expected_decimals = 4;
    • setExpectedDecimals

      public TokenTransferList.Builder setExpectedDecimals(com.google.protobuf.UInt32Value.Builder builderForValue)
       *
       An expected decimal precision.<br/>
       This is the number of decimals a fungible/common token type is
       _expected_ to have.
       <p>
       The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS`
       if this is set and the actual decimals specified for the `Token` differ
       from this value.<br/>
       If `nftTransfers` is set, then this value SHOULD NOT be set.
       
      .google.protobuf.UInt32Value expected_decimals = 4;
    • mergeExpectedDecimals

      public TokenTransferList.Builder mergeExpectedDecimals(com.google.protobuf.UInt32Value value)
       *
       An expected decimal precision.<br/>
       This is the number of decimals a fungible/common token type is
       _expected_ to have.
       <p>
       The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS`
       if this is set and the actual decimals specified for the `Token` differ
       from this value.<br/>
       If `nftTransfers` is set, then this value SHOULD NOT be set.
       
      .google.protobuf.UInt32Value expected_decimals = 4;
    • clearExpectedDecimals

      public TokenTransferList.Builder clearExpectedDecimals()
       *
       An expected decimal precision.<br/>
       This is the number of decimals a fungible/common token type is
       _expected_ to have.
       <p>
       The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS`
       if this is set and the actual decimals specified for the `Token` differ
       from this value.<br/>
       If `nftTransfers` is set, then this value SHOULD NOT be set.
       
      .google.protobuf.UInt32Value expected_decimals = 4;