Class ImmutableDefaultPublicKey

java.lang.Object
org.xrpl.xrpl4j.crypto.PublicKey.DefaultPublicKey
org.xrpl.xrpl4j.crypto.ImmutableDefaultPublicKey
All Implemented Interfaces:
PublicKey

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableDefaultPublicKey extends PublicKey.DefaultPublicKey
Immutable implementation of PublicKey.DefaultPublicKey.

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

  • Method Details

    • value

      public UnsignedByteArray value()
      The key in binary (Note: will be 33 bytes).
      Returns:
      An instance of UnsignedByteArray.
    • base58Encoded

      public String base58Encoded()
      Description copied from interface: PublicKey
      The public-key, as a base-58 encoded String.
      Specified by:
      base58Encoded in interface PublicKey
      Overrides:
      base58Encoded in class PublicKey.DefaultPublicKey
      Returns:
      The computed-at-construction value of the base58Encoded attribute
    • base16Encoded

      public String base16Encoded()
      Description copied from interface: PublicKey
      The private-key value, as a Base16-encoded (i.e., HEX) string. Note that if this is an Ed25519 private-key, then this value contains a leading prefix of `ED`, in hex.
      Specified by:
      base16Encoded in interface PublicKey
      Overrides:
      base16Encoded in class PublicKey.DefaultPublicKey
      Returns:
      The computed-at-construction value of the base16Encoded attribute
    • versionType

      public VersionType versionType()
      Description copied from interface: PublicKey
      The type of this key.
      Specified by:
      versionType in interface PublicKey
      Overrides:
      versionType in class PublicKey.DefaultPublicKey
      Returns:
      The computed-at-construction value of the versionType attribute
    • withValue

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableDefaultPublicKey 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: value, base58Encoded, base16Encoded, versionType.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • copyOf

      public static ImmutableDefaultPublicKey copyOf(PublicKey.DefaultPublicKey instance)
      Creates an immutable copy of a PublicKey.DefaultPublicKey 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 DefaultPublicKey instance
    • builder

      public static ImmutableDefaultPublicKey.Builder builder()
      Creates a builder for ImmutableDefaultPublicKey.
       ImmutableDefaultPublicKey.builder()
          .value(org.xrpl.xrpl4j.codec.addresses.UnsignedByteArray) // required value
          .build();
       
      Returns:
      A new ImmutableDefaultPublicKey builder