Class ImmutableIssue

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableIssue
All Implemented Interfaces:
Issue

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

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

  • Method Details

    • currency

      public String currency()
      Either a 3 character currency code, or a 40 character hexadecimal encoded currency code value.
      Specified by:
      currency in interface Issue
      Returns:
      A String containing the currency code.
    • issuer

      public Optional<Address> issuer()
      The Address of the issuer of the currency, or empty if the currency is XRP.
      Specified by:
      issuer in interface Issue
      Returns:
      The Address of the issuer account.
    • withCurrency

      public final ImmutableIssue withCurrency(String value)
      Copy the current immutable object by setting a value for the currency attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for currency
      Returns:
      A modified copy of the this object
    • withIssuer

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

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

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

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

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

      public static ImmutableIssue.Builder builder()
      Creates a builder for ImmutableIssue.
       ImmutableIssue.builder()
          .currency(String) // required currency
          .issuer(org.xrpl.xrpl4j.model.transactions.Address) // optional issuer
          .build();
       
      Returns:
      A new ImmutableIssue builder