Class ImmutableDecoded

java.lang.Object
org.xrpl.xrpl4j.codec.addresses.ImmutableDecoded
All Implemented Interfaces:
Decoded

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

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

  • Method Details

    • version

      public Version version()
      The Version of the decoded Base58 String.
      Specified by:
      version in interface Decoded
      Returns:
      A Version.
    • bytes

      public UnsignedByteArray bytes()
      The bytes of the decoded Base58 String.
      Specified by:
      bytes in interface Decoded
      Returns:
      An UnsignedByteArray.
    • type

      public Optional<KeyType> type()
      The KeyType of the decoded Base58 String.
      Specified by:
      type in interface Decoded
      Returns:
      An optionally present KeyType.
    • withVersion

      public final ImmutableDecoded withVersion(Version value)
      Copy the current immutable object by setting a value for the version attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for version
      Returns:
      A modified copy of the this object
    • withBytes

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

      public final ImmutableDecoded withType(KeyType value)
      Copy the current immutable object by setting a present value for the optional type attribute.
      Parameters:
      value - The value for type
      Returns:
      A modified copy of this object
    • withType

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

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

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

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

      public static ImmutableDecoded.Builder builder()
      Creates a builder for ImmutableDecoded.
       ImmutableDecoded.builder()
          .version(org.xrpl.xrpl4j.codec.addresses.Version) // required version
          .bytes(org.xrpl.xrpl4j.codec.addresses.UnsignedByteArray) // required bytes
          .type(org.xrpl.xrpl4j.codec.addresses.KeyType) // optional type
          .build();
       
      Returns:
      A new ImmutableDecoded builder