Package org.xrpl.xrpl4j.crypto.keys
Class ImmutableKeyPair
java.lang.Object
org.xrpl.xrpl4j.crypto.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.Builderbuilder()Creates a builder forImmutableKeyPair.static ImmutableKeyPairCreates an immutable copy of aKeyPairvalue.booleanThis instance is equal to all instances ofImmutableKeyPairthat have equal attribute values.inthashCode()Computes a hash code from attributes:privateKey,publicKey.The private key of thisKeyPair.The public key of thisKeyPair.toString()Prints the immutable valueKeyPairwith attribute values.final ImmutableKeyPairwithPrivateKey(PrivateKey value) Copy the current immutable object by setting a value for theprivateKeyattribute.final ImmutableKeyPairwithPublicKey(PublicKey value) Copy the current immutable object by setting a value for thepublicKeyattribute.
-
Method Details
-
privateKey
The private key of thisKeyPair.- Specified by:
privateKeyin interfaceKeyPair- Returns:
- A
PrivateKeycontaining the private key.
-
publicKey
The public key of thisKeyPair. -
withPrivateKey
Copy the current immutable object by setting a value for theprivateKeyattribute. 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
thisobject
-
withPublicKey
Copy the current immutable object by setting a value for thepublicKeyattribute. 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
thisobject
-
equals
This instance is equal to all instances ofImmutableKeyPairthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:privateKey,publicKey. -
toString
Prints the immutable valueKeyPairwith attribute values. -
copyOf
Creates an immutable copy of aKeyPairvalue. 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.keys.PrivateKey) // requiredprivateKey.publicKey(org.xrpl.xrpl4j.crypto.keys.PublicKey) // requiredpublicKey.build();- Returns:
- A new ImmutableKeyPair builder
-