Class ImmutableNfToken

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableNfToken
All Implemented Interfaces:
NfToken

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

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

  • Method Details

    • nfTokenId

      public NfTokenId nfTokenId()
      The unique NFTokenID of the token.
      Specified by:
      nfTokenId in interface NfToken
      Returns:
      The unique NFTokenID of the token.
    • uri

      public Optional<NfTokenUri> uri()
      The URI for the data of the token.
      Specified by:
      uri in interface NfToken
      Returns:
      The URI for the data of the token.
    • withNfTokenId

      public final ImmutableNfToken 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
    • withUri

      public final ImmutableNfToken withUri(NfTokenUri value)
      Copy the current immutable object by setting a present value for the optional uri attribute.
      Parameters:
      value - The value for uri
      Returns:
      A modified copy of this object
    • withUri

      public final ImmutableNfToken withUri(Optional<? extends NfTokenUri> optional)
      Copy the current immutable object by setting an optional value for the uri 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 uri
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableNfToken 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: nfTokenId, uri.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableNfToken copyOf(NfToken instance)
      Creates an immutable copy of a NfToken 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 NfToken instance
    • builder

      public static ImmutableNfToken.Builder builder()
      Creates a builder for ImmutableNfToken.
       ImmutableNfToken.builder()
          .nfTokenId(org.xrpl.xrpl4j.model.transactions.NfTokenId) // required nfTokenId
          .uri(org.xrpl.xrpl4j.model.transactions.NfTokenUri) // optional uri
          .build();
       
      Returns:
      A new ImmutableNfToken builder