Class ImmutableClassicAddress

java.lang.Object
org.xrpl.xrpl4j.codec.addresses.ImmutableClassicAddress
All Implemented Interfaces:
ClassicAddress

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

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

  • Method Details

    • classicAddress

      public Address classicAddress()
      A classic address, as an Address.
      Specified by:
      classicAddress in interface ClassicAddress
      Returns:
      An Address containing the classic address.
    • tag

      public com.google.common.primitives.UnsignedInteger tag()
      The tag of the classic address.
      Specified by:
      tag in interface ClassicAddress
      Returns:
      An UnsignedInteger.
    • test

      public boolean test()
      Whether or not this address exists on mainnet or testnet.
      Specified by:
      test in interface ClassicAddress
      Returns:
      true if it is a tesnet address, false if it is mainnet.
    • withClassicAddress

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

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

      public final ImmutableClassicAddress withTest(boolean value)
      Copy the current immutable object by setting a value for the test attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for test
      Returns:
      A modified copy of the this object
    • equals

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

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

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

      public static ImmutableClassicAddress.Builder builder()
      Creates a builder for ImmutableClassicAddress.
       ImmutableClassicAddress.builder()
          .classicAddress(org.xrpl.xrpl4j.model.transactions.Address) // required classicAddress
          .tag(com.google.common.primitives.UnsignedInteger) // required tag
          .test(boolean) // required test
          .build();
       
      Returns:
      A new ImmutableClassicAddress builder