Package org.xrpl.xrpl4j.crypto
Class ImmutableKeyMetadata.Builder
java.lang.Object
org.xrpl.xrpl4j.crypto.ImmutableKeyMetadata.Builder
- Enclosing class:
- ImmutableKeyMetadata
Builds instances of type
ImmutableKeyMetadata
.
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 newImmutableKeyMetadata
.from
(KeyMetadata instance) Fill a builder with attribute values from the providedorg.xrpl.xrpl4j.crypto.KeyMetadata
instance.from
(KeyMetadata.AbstractKeyMetadata instance) Fill a builder with attribute values from the providedorg.xrpl.xrpl4j.crypto.KeyMetadata.AbstractKeyMetadata
instance.keyIdentifier
(String keyIdentifier) Initializes the value for thekeyIdentifier
attribute.keyPassword
(String keyPassword) Initializes the optional valuekeyPassword
to keyPassword.keyPassword
(Optional<String> keyPassword) Initializes the optional valuekeyPassword
to keyPassword.keyringIdentifier
(String keyringIdentifier) Initializes the value for thekeyringIdentifier
attribute.keyVersion
(String keyVersion) Initializes the value for thekeyVersion
attribute.platformIdentifier
(String platformIdentifier) Initializes the value for theplatformIdentifier
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedorg.xrpl.xrpl4j.crypto.KeyMetadata
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableKeyMetadata.Builder from(KeyMetadata.AbstractKeyMetadata instance) Fill a builder with attribute values from the providedorg.xrpl.xrpl4j.crypto.KeyMetadata.AbstractKeyMetadata
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
platformIdentifier
@CanIgnoreReturnValue public final ImmutableKeyMetadata.Builder platformIdentifier(String platformIdentifier) Initializes the value for theplatformIdentifier
attribute.- Parameters:
platformIdentifier
- The value for platformIdentifier- Returns:
this
builder for use in a chained invocation
-
keyringIdentifier
@CanIgnoreReturnValue public final ImmutableKeyMetadata.Builder keyringIdentifier(String keyringIdentifier) Initializes the value for thekeyringIdentifier
attribute.- Parameters:
keyringIdentifier
- The value for keyringIdentifier- Returns:
this
builder for use in a chained invocation
-
keyIdentifier
Initializes the value for thekeyIdentifier
attribute.- Parameters:
keyIdentifier
- The value for keyIdentifier- Returns:
this
builder for use in a chained invocation
-
keyVersion
Initializes the value for thekeyVersion
attribute.- Parameters:
keyVersion
- The value for keyVersion- Returns:
this
builder for use in a chained invocation
-
keyPassword
Initializes the optional valuekeyPassword
to keyPassword.- Parameters:
keyPassword
- The value for keyPassword- Returns:
this
builder for chained invocation
-
keyPassword
@CanIgnoreReturnValue public final ImmutableKeyMetadata.Builder keyPassword(Optional<String> keyPassword) Initializes the optional valuekeyPassword
to keyPassword.- Parameters:
keyPassword
- The value for keyPassword- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableKeyMetadata
.- Returns:
- An immutable instance of KeyMetadata
- Throws:
IllegalStateException
- if any required attributes are missing
-