Class ImmutableDecodedXAddress

java.lang.Object
org.xrpl.xrpl4j.codec.addresses.ImmutableDecodedXAddress
All Implemented Interfaces:
DecodedXAddress

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

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

  • Method Details

    • accountId

      public UnsignedByteArray accountId()
      The Account ID of the X-Address.
      Specified by:
      accountId in interface DecodedXAddress
      Returns:
      An UnsignedByteArray containing the Account ID.
    • tag

      public com.google.common.primitives.UnsignedInteger tag()
      The tag of the X-Address.
      Specified by:
      tag in interface DecodedXAddress
      Returns:
      An UnsignedInteger representing the tag.
    • test

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

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

      public final ImmutableDecodedXAddress 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 ImmutableDecodedXAddress 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 ImmutableDecodedXAddress 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: accountId, tag, test.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableDecodedXAddress.Builder builder()
      Creates a builder for ImmutableDecodedXAddress.
       ImmutableDecodedXAddress.builder()
          .accountId(org.xrpl.xrpl4j.codec.addresses.UnsignedByteArray) // required accountId
          .tag(com.google.common.primitives.UnsignedInteger) // required tag
          .test(boolean) // required test
          .build();
       
      Returns:
      A new ImmutableDecodedXAddress builder