Package org.xrpl.xrpl4j.wallet
Class ImmutableWallet
java.lang.Object
org.xrpl.xrpl4j.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
-
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableWallet.Builder
builder()
Creates a builder forImmutableWallet
.The XRPL address of this wallet, in the Classic Address form.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
,classicAddress
,xAddress
,isTest
.boolean
isTest()
Whether or not this wallet is on XRPL testnet or mainnet.Deprecated.This method will be removed in a future version.The public key of the wallet, encoded in hexadecimal.toString()
Prints the immutable valueWallet
with attribute values.final ImmutableWallet
withClassicAddress
(Address value) Copy the current immutable object by setting a value for theclassicAddress
attribute.final ImmutableWallet
withIsTest
(boolean value) Copy the current immutable object by setting a value for theisTest
attribute.final ImmutableWallet
withPrivateKey
(String value) Deprecated.final ImmutableWallet
withPrivateKey
(Optional<String> optional) Deprecated.final ImmutableWallet
withPublicKey
(String value) Copy the current immutable object by setting a value for thepublicKey
attribute.final ImmutableWallet
withXAddress
(XAddress value) Copy the current immutable object by setting a value for thexAddress
attribute.xAddress()
The XRPL address of this wallet, in the X-Address form.
-
Method Details
-
privateKey
Deprecated.This method will be removed in a future version. Consider storing private keys in an associated instance of TransactionSigner.The private key of the wallet, encoded in hexadecimal.- Specified by:
privateKey
in interfaceWallet
- Returns:
- An optionally present
String
containing a private key.
-
publicKey
The public key of the wallet, encoded in hexadecimal. -
classicAddress
The XRPL address of this wallet, in the Classic Address form.- Specified by:
classicAddress
in interfaceWallet
- Returns:
- The classic
Address
of this wallet.
-
xAddress
The XRPL address of this wallet, in the X-Address form. -
isTest
public boolean isTest()Whether or not this wallet is on XRPL testnet or mainnet. -
withPrivateKey
Deprecated.Copy the current immutable object by setting a present value for the optionalprivateKey
attribute.- Parameters:
value
- The value for privateKey- Returns:
- A modified copy of
this
object
-
withPrivateKey
Deprecated.Copy the current immutable object by setting an optional value for theprivateKey
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for privateKey- Returns:
- A modified copy of
this
object
-
withPublicKey
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
-
withClassicAddress
Copy the current immutable object by setting a value for theclassicAddress
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for classicAddress- Returns:
- A modified copy of the
this
object
-
withXAddress
Copy the current immutable object by setting a value for thexAddress
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for xAddress- Returns:
- A modified copy of the
this
object
-
withIsTest
Copy the current immutable object by setting a value for theisTest
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for isTest- 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
,classicAddress
,xAddress
,isTest
. -
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(String) // optional
privateKey
.publicKey(String) // requiredpublicKey
.classicAddress(org.xrpl.xrpl4j.model.transactions.Address) // requiredclassicAddress
.xAddress(org.xrpl.xrpl4j.model.transactions.XAddress) // requiredxAddress
.isTest(boolean) // requiredisTest
.build();- Returns:
- A new ImmutableWallet builder
-