Package org.xrpl.xrpl4j.crypto.keys
Class ImmutablePublicKey
java.lang.Object
org.xrpl.xrpl4j.crypto.keys.ImmutablePublicKey
- All Implemented Interfaces:
PublicKey
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutablePublicKey
extends Object
implements PublicKey
Immutable implementation of
PublicKey.
Use the builder to create immutable instances:
ImmutablePublicKey.builder().
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.xrpl.xrpl4j.crypto.keys.PublicKey
ED2559_PREFIX, MULTI_SIGN_PUBLIC_KEY -
Method Summary
Modifier and TypeMethodDescriptionThe private-key value, as a Base16-encoded (i.e., HEX) string.The public-key, as a base-58 encodedString.static ImmutablePublicKey.Builderbuilder()Creates a builder forImmutablePublicKey.static ImmutablePublicKeyCreates an immutable copy of aPublicKeyvalue.Derive an XRPL address from this public key.booleanThis instance is equal to all instances ofImmutablePublicKeythat have equal attribute values.inthashCode()Computes a hash code from attributes:value,base58Value,base16Value,keyType.keyType()The type of this key.toString()Prints the immutable valuePublicKeywith attribute values.value()The key in binary (Note: will be 33 bytes).final ImmutablePublicKeywithValue(UnsignedByteArray value) Copy the current immutable object by setting a value for thevalueattribute.
-
Method Details
-
value
The key in binary (Note: will be 33 bytes).- Specified by:
valuein interfacePublicKey- Returns:
- An instance of
UnsignedByteArray.
-
base58Value
The public-key, as a base-58 encodedString.- Specified by:
base58Valuein interfacePublicKey- Returns:
- A
String.
-
base16Value
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:
base16Valuein interfacePublicKey- Returns:
- A
String.
-
keyType
The type of this key. -
withValue
Copy the current immutable object by setting a value for thevalueattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for value- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutablePublicKeythat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:value,base58Value,base16Value,keyType. -
toString
Prints the immutable valuePublicKeywith attribute values. -
deriveAddress
Derive an XRPL address from this public key.Returns a lazily initialized value of the
deriveAddressattribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
deriveAddressin interfacePublicKey- Returns:
- A lazily initialized value of the
deriveAddressattribute
-
copyOf
Creates an immutable copy of aPublicKeyvalue. 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 PublicKey instance
-
builder
Creates a builder forImmutablePublicKey.ImmutablePublicKey.builder() .value(org.xrpl.xrpl4j.codec.addresses.UnsignedByteArray) // requiredvalue.build();- Returns:
- A new ImmutablePublicKey builder
-