Package org.xrpl.xrpl4j.crypto.core.keys
Class ImmutablePublicKey
java.lang.Object
org.xrpl.xrpl4j.crypto.core.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 ClassesNested classes/interfaces inherited from interface org.xrpl.xrpl4j.crypto.core.keys.PublicKey
PublicKey.PublicKeyDeserializer, PublicKey.PublicKeySerializer
-
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.Builder
builder()
Creates a builder forImmutablePublicKey
.static ImmutablePublicKey
Creates an immutable copy of aPublicKey
value.boolean
This instance is equal to all instances ofImmutablePublicKey
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:value
,base58Value
,base16Value
,versionType
.toString()
Prints the immutable valuePublicKey
with attribute values.value()
The key in binary (Note: will be 33 bytes).The type of this key.final ImmutablePublicKey
withValue
(UnsignedByteArray value) Copy the current immutable object by setting a value for thevalue
attribute.
-
Method Details
-
value
The key in binary (Note: will be 33 bytes).- Specified by:
value
in interfacePublicKey
- Returns:
- An instance of
UnsignedByteArray
.
-
base58Value
The public-key, as a base-58 encodedString
.- Specified by:
base58Value
in 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:
base16Value
in interfacePublicKey
- Returns:
- A
String
.
-
versionType
The type of this key.- Specified by:
versionType
in interfacePublicKey
- Returns:
- A
VersionType
.
-
withValue
Copy the current immutable object by setting a value for thevalue
attribute. 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
this
object
-
equals
This instance is equal to all instances ofImmutablePublicKey
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:value
,base58Value
,base16Value
,versionType
. -
toString
Prints the immutable valuePublicKey
with attribute values. -
copyOf
Creates an immutable copy of aPublicKey
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 PublicKey instance
-
builder
Creates a builder forImmutablePublicKey
.ImmutablePublicKey.builder() .value(org.xrpl.xrpl4j.codec.addresses.UnsignedByteArray) // required
value
.build();- Returns:
- A new ImmutablePublicKey builder
-