Class ImmutableWallet
java.lang.Object
org.xrpl.xrpl4j.crypto.core.wallet.ImmutableWallet
- All Implemented Interfaces:
Wallet
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableWallet
extends Object
implements Wallet
Immutable implementation of
Wallet
.
Use the builder to create immutable instances:
ImmutableWallet.builder()
.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionaddress()
The XRPL address of this wallet, in the Classic Address form.static ImmutableWallet.Builder
builder()
Creates a builder forImmutableWallet
.static ImmutableWallet
Creates an immutable copy of aWallet
value.boolean
This instance is equal to all instances ofImmutableWallet
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:privateKey
,publicKey
,address
.The private key of the wallet, encoded in hexadecimal.The public key of thisWallet
.toString()
Prints the immutable valueWallet
with attribute values.final ImmutableWallet
withAddress
(Address value) Copy the current immutable object by setting a value for theaddress
attribute.final ImmutableWallet
withPrivateKey
(PrivateKey value) Copy the current immutable object by setting a value for theprivateKey
attribute.final ImmutableWallet
withPublicKey
(PublicKey value) Copy the current immutable object by setting a value for thepublicKey
attribute.
-
Method Details
-
privateKey
The private key of the wallet, encoded in hexadecimal. Non-optional because wallets are only used when private keys are in-memory. For delegated key environments, wallet will not be used (instead just a PublicKey will be used).- Specified by:
privateKey
in interfaceWallet
- Returns:
- An optionally present
PrivateKey
containing a private key.
-
publicKey
The public key of thisWallet
. -
address
The XRPL address of this wallet, in the Classic Address form. -
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
-
withAddress
Copy the current immutable object by setting a value for theaddress
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for address- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableWallet
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:privateKey
,publicKey
,address
. -
toString
Prints the immutable valueWallet
with attribute values. -
copyOf
Creates an immutable copy of aWallet
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 Wallet instance
-
builder
Creates a builder forImmutableWallet
.ImmutableWallet.builder() .privateKey(org.xrpl.xrpl4j.crypto.core.keys.PrivateKey) // required
privateKey
.publicKey(org.xrpl.xrpl4j.crypto.core.keys.PublicKey) // requiredpublicKey
.address(org.xrpl.xrpl4j.model.transactions.Address) // requiredaddress
.build();- Returns:
- A new ImmutableWallet builder
-