Package org.xrpl.xrpl4j.keypairs
Class ImmutableKeyPair
- java.lang.Object
-
- org.xrpl.xrpl4j.keypairs.ImmutableKeyPair
-
- All Implemented Interfaces:
KeyPair
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableKeyPair extends Object implements KeyPair
Immutable implementation ofKeyPair
.Use the builder to create immutable instances:
ImmutableKeyPair.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableKeyPair.Builder
Builds instances of typeImmutableKeyPair
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableKeyPair.Builder
builder()
Creates a builder forImmutableKeyPair
.static ImmutableKeyPair
copyOf(KeyPair instance)
Creates an immutable copy of aKeyPair
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableKeyPair
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:privateKey
,publicKey
.String
privateKey()
The private key of thisKeyPair
.String
publicKey()
The public key of thisKeyPair
.String
toString()
Prints the immutable valueKeyPair
with attribute values.ImmutableKeyPair
withPrivateKey(String value)
Copy the current immutable object by setting a value for theprivateKey
attribute.ImmutableKeyPair
withPublicKey(String value)
Copy the current immutable object by setting a value for thepublicKey
attribute.
-
-
-
Method Detail
-
privateKey
public String privateKey()
The private key of thisKeyPair
.- Specified by:
privateKey
in interfaceKeyPair
- Returns:
- A
String
containing the private key.
-
withPrivateKey
public final ImmutableKeyPair withPrivateKey(String value)
Copy the current immutable object by setting a value for theprivateKey
attribute. An equals check 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
public final ImmutableKeyPair withPublicKey(String value)
Copy the current immutable object by setting a value for thepublicKey
attribute. An equals check 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
public boolean equals(@Nullable Object another)
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
public String toString()
Prints the immutable valueKeyPair
with attribute values.
-
copyOf
public static ImmutableKeyPair copyOf(KeyPair instance)
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
public static ImmutableKeyPair.Builder builder()
Creates a builder forImmutableKeyPair
.ImmutableKeyPair.builder() .privateKey(String) // required
privateKey
.publicKey(String) // requiredpublicKey
.build();- Returns:
- A new ImmutableKeyPair builder
-
-