Class ImmutableNfTokenOfferObject

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableNfTokenOfferObject
All Implemented Interfaces:
LedgerObject, NfTokenOfferObject

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableNfTokenOfferObject extends Object implements NfTokenOfferObject
Immutable implementation of NfTokenOfferObject.

Use the builder to create immutable instances: ImmutableNfTokenOfferObject.builder().

  • Method Details

    • ledgerEntryType

      public LedgerObject.LedgerEntryType ledgerEntryType()
      The type of ledger object. In this case, this is always "NfTokenOffer".
      Specified by:
      ledgerEntryType in interface NfTokenOfferObject
      Returns:
      Always LedgerObject.LedgerEntryType.NFTOKEN_OFFER.
    • amount

      public CurrencyAmount amount()
      The amount expected or offered for the token.
      Specified by:
      amount in interface NfTokenOfferObject
      Returns:
      The CurrencyAmount.
    • owner

      public Address owner()
      Address of the source account that created and owns the offer.
      Specified by:
      owner in interface NfTokenOfferObject
      Returns:
      The Address of the NfTokenOffer owner.
    • previousTransactionId

      public Hash256 previousTransactionId()
      The identifying hash of the transaction that most recently modified this object.
      Specified by:
      previousTransactionId in interface NfTokenOfferObject
      Returns:
      A Hash256 containing the previous transaction hash.
    • previousTransactionLedgerSequence

      public com.google.common.primitives.UnsignedInteger previousTransactionLedgerSequence()
      The index of the ledger that contains the transaction that most recently modified this object.
      Specified by:
      previousTransactionLedgerSequence in interface NfTokenOfferObject
      Returns:
      An UnsignedInteger representing the previous transaction ledger sequence.
    • nfTokenId

      public NfTokenId nfTokenId()
      The TokenId of the NfToken for which the offer has been created.
      Specified by:
      nfTokenId in interface NfTokenOfferObject
      Returns:
      NfTokenId of the NfToken.
    • expiration

      public Optional<com.google.common.primitives.UnsignedInteger> expiration()
      A time after which this offer is considered unfunded, as the number of seconds since the Ripple Epoch.
      Specified by:
      expiration in interface NfTokenOfferObject
      Returns:
      The offer's expiration.
    • destination

      public Optional<Address> destination()
      The intended recipient of the NfTokenObject. This address will receive the NFToken when the offer is accepted.
      Specified by:
      destination in interface NfTokenOfferObject
      Returns:
      The Address of the destination.
    • ownerNode

      public Optional<String> ownerNode()
      A hint indicating which page of the sender's owner directory links to this object, in case the directory consists of multiple pages. Note: The object does not contain a direct link to the owner directory containing it, since that value can be derived from the Account.
      Specified by:
      ownerNode in interface NfTokenOfferObject
      Returns:
      A String containing the hint.
    • offerNode

      public Optional<String> offerNode()
      A hint indicating which page of the token buy or sell offer directory links to this object.
      Specified by:
      offerNode in interface NfTokenOfferObject
      Returns:
      A String containing the hint.
    • flags

      public NfTokenOfferFlags flags()
      A set of boolean NfTokenOfferFlags containing options enabled for this object.
      Specified by:
      flags in interface NfTokenOfferObject
      Returns:
      The NfTokenOfferFlags for this object.
    • index

      public Hash256 index()
      The unique ID of this NfTokenOfferObject.
      Specified by:
      index in interface NfTokenOfferObject
      Returns:
      A Hash256 containing the ID.
    • withAmount

      public final ImmutableNfTokenOfferObject withAmount(CurrencyAmount value)
      Copy the current immutable object by setting a value for the amount attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for amount
      Returns:
      A modified copy of the this object
    • withOwner

      public final ImmutableNfTokenOfferObject withOwner(Address value)
      Copy the current immutable object by setting a value for the owner attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for owner
      Returns:
      A modified copy of the this object
    • withPreviousTransactionId

      public final ImmutableNfTokenOfferObject withPreviousTransactionId(Hash256 value)
      Copy the current immutable object by setting a value for the previousTransactionId attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for previousTransactionId
      Returns:
      A modified copy of the this object
    • withPreviousTransactionLedgerSequence

      public final ImmutableNfTokenOfferObject withPreviousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a value for the previousTransactionLedgerSequence attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for previousTransactionLedgerSequence
      Returns:
      A modified copy of the this object
    • withNfTokenId

      public final ImmutableNfTokenOfferObject withNfTokenId(NfTokenId value)
      Copy the current immutable object by setting a value for the nfTokenId attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for nfTokenId
      Returns:
      A modified copy of the this object
    • withExpiration

      public final ImmutableNfTokenOfferObject withExpiration(com.google.common.primitives.UnsignedInteger value)
      Copy the current immutable object by setting a present value for the optional expiration attribute.
      Parameters:
      value - The value for expiration
      Returns:
      A modified copy of this object
    • withExpiration

      public final ImmutableNfTokenOfferObject withExpiration(Optional<? extends com.google.common.primitives.UnsignedInteger> optional)
      Copy the current immutable object by setting an optional value for the expiration attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for expiration
      Returns:
      A modified copy of this object
    • withDestination

      public final ImmutableNfTokenOfferObject withDestination(Address value)
      Copy the current immutable object by setting a present value for the optional destination attribute.
      Parameters:
      value - The value for destination
      Returns:
      A modified copy of this object
    • withDestination

      public final ImmutableNfTokenOfferObject withDestination(Optional<? extends Address> optional)
      Copy the current immutable object by setting an optional value for the destination attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for destination
      Returns:
      A modified copy of this object
    • withOwnerNode

      public final ImmutableNfTokenOfferObject withOwnerNode(String value)
      Copy the current immutable object by setting a present value for the optional ownerNode attribute.
      Parameters:
      value - The value for ownerNode
      Returns:
      A modified copy of this object
    • withOwnerNode

      public final ImmutableNfTokenOfferObject withOwnerNode(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the ownerNode attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for ownerNode
      Returns:
      A modified copy of this object
    • withOfferNode

      public final ImmutableNfTokenOfferObject withOfferNode(String value)
      Copy the current immutable object by setting a present value for the optional offerNode attribute.
      Parameters:
      value - The value for offerNode
      Returns:
      A modified copy of this object
    • withOfferNode

      public final ImmutableNfTokenOfferObject withOfferNode(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the offerNode attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for offerNode
      Returns:
      A modified copy of this object
    • withFlags

      public final ImmutableNfTokenOfferObject withFlags(NfTokenOfferFlags value)
      Copy the current immutable object by setting a value for the flags attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for flags
      Returns:
      A modified copy of the this object
    • withIndex

      public final ImmutableNfTokenOfferObject withIndex(Hash256 value)
      Copy the current immutable object by setting a value for the index attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for index
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableNfTokenOfferObject that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: ledgerEntryType, amount, owner, previousTransactionId, previousTransactionLedgerSequence, nfTokenId, expiration, destination, ownerNode, offerNode, flags, index.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value NfTokenOfferObject with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableNfTokenOfferObject copyOf(NfTokenOfferObject instance)
      Creates an immutable copy of a NfTokenOfferObject value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable NfTokenOfferObject instance
    • builder

      public static ImmutableNfTokenOfferObject.Builder builder()
      Creates a builder for ImmutableNfTokenOfferObject.
       ImmutableNfTokenOfferObject.builder()
          .amount(org.xrpl.xrpl4j.model.transactions.CurrencyAmount) // required amount
          .owner(org.xrpl.xrpl4j.model.transactions.Address) // required owner
          .previousTransactionId(org.xrpl.xrpl4j.model.transactions.Hash256) // required previousTransactionId
          .previousTransactionLedgerSequence(com.google.common.primitives.UnsignedInteger) // required previousTransactionLedgerSequence
          .nfTokenId(org.xrpl.xrpl4j.model.transactions.NfTokenId) // required nfTokenId
          .expiration(com.google.common.primitives.UnsignedInteger) // optional expiration
          .destination(org.xrpl.xrpl4j.model.transactions.Address) // optional destination
          .ownerNode(String) // optional ownerNode
          .offerNode(String) // optional offerNode
          .flags(org.xrpl.xrpl4j.model.flags.NfTokenOfferFlags) // required flags
          .index(org.xrpl.xrpl4j.model.transactions.Hash256) // required index
          .build();
       
      Returns:
      A new ImmutableNfTokenOfferObject builder