Package org.xrpl.xrpl4j.wallet
Class ImmutableWallet.Builder
java.lang.Object
org.xrpl.xrpl4j.wallet.ImmutableWallet.Builder
- Enclosing class:
- ImmutableWallet
Builds instances of type
ImmutableWallet
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newImmutableWallet
.final ImmutableWallet.Builder
classicAddress
(Address classicAddress) Initializes the value for theclassicAddress
attribute.final ImmutableWallet.Builder
Fill a builder with attribute values from the providedWallet
instance.final ImmutableWallet.Builder
isTest
(boolean isTest) Initializes the value for theisTest
attribute.final ImmutableWallet.Builder
privateKey
(String privateKey) Deprecated.final ImmutableWallet.Builder
privateKey
(Optional<String> privateKey) Deprecated.final ImmutableWallet.Builder
Initializes the value for thepublicKey
attribute.final ImmutableWallet.Builder
Initializes the value for thexAddress
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedWallet
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
privateKey
@CanIgnoreReturnValue @Deprecated public final ImmutableWallet.Builder privateKey(String privateKey) Deprecated.Initializes the optional valueprivateKey
to privateKey.- Parameters:
privateKey
- The value for privateKey- Returns:
this
builder for chained invocation
-
privateKey
@CanIgnoreReturnValue @Deprecated public final ImmutableWallet.Builder privateKey(Optional<String> privateKey) Deprecated.Initializes the optional valueprivateKey
to privateKey.- Parameters:
privateKey
- The value for privateKey- Returns:
this
builder for use in a chained invocation
-
publicKey
Initializes the value for thepublicKey
attribute.- Parameters:
publicKey
- The value for publicKey- Returns:
this
builder for use in a chained invocation
-
classicAddress
Initializes the value for theclassicAddress
attribute.- Parameters:
classicAddress
- The value for classicAddress- Returns:
this
builder for use in a chained invocation
-
xAddress
Initializes the value for thexAddress
attribute.- Parameters:
xAddress
- The value for xAddress- Returns:
this
builder for use in a chained invocation
-
isTest
Initializes the value for theisTest
attribute.- Parameters:
isTest
- The value for isTest- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableWallet
.- Returns:
- An immutable instance of Wallet
- Throws:
IllegalStateException
- if any required attributes are missing
-