Package org.xrpl.xrpl4j.crypto.core.keys
Class ImmutableKeyPair
java.lang.Object
org.xrpl.xrpl4j.crypto.core.keys.ImmutableKeyPair
- All Implemented Interfaces:
KeyPair
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableKeyPair
extends Object
implements KeyPair
Immutable implementation of
KeyPair
.
Use the builder to create immutable instances:
ImmutableKeyPair.builder()
.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableKeyPair.Builder
builder()
Creates a builder forImmutableKeyPair
.static ImmutableKeyPair
Creates an immutable copy of aKeyPair
value.boolean
This instance is equal to all instances ofImmutableKeyPair
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:privateKey
,publicKey
.The private key of thisKeyPair
.The public key of thisKeyPair
.toString()
Prints the immutable valueKeyPair
with attribute values.final ImmutableKeyPair
withPrivateKey
(PrivateKey value) Copy the current immutable object by setting a value for theprivateKey
attribute.final ImmutableKeyPair
withPublicKey
(PublicKey value) Copy the current immutable object by setting a value for thepublicKey
attribute.
-
Method Details
-
privateKey
The private key of thisKeyPair
.- Specified by:
privateKey
in interfaceKeyPair
- Returns:
- A
PrivateKey
containing the private key.
-
publicKey
The public key of thisKeyPair
. -
withPrivateKey
Copy the current immutable object by setting a value for theprivateKey
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for privateKey- Returns:
- A modified copy of the
this
object
-
withPublicKey
Copy the current immutable object by setting a value for thepublicKey
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for publicKey- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableKeyPair
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:privateKey
,publicKey
. -
toString
Prints the immutable valueKeyPair
with attribute values. -
copyOf
Creates an immutable copy of aKeyPair
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 KeyPair instance
-
builder
Creates a builder forImmutableKeyPair
.ImmutableKeyPair.builder() .privateKey(org.xrpl.xrpl4j.crypto.core.keys.PrivateKey) // required
privateKey
.publicKey(org.xrpl.xrpl4j.crypto.core.keys.PublicKey) // requiredpublicKey
.build();- Returns:
- A new ImmutableKeyPair builder
-