Class ImmutableKeyMetadata

java.lang.Object
org.xrpl.xrpl4j.crypto.core.KeyMetadata.AbstractKeyMetadata
org.xrpl.xrpl4j.crypto.core.ImmutableKeyMetadata
All Implemented Interfaces:
KeyMetadata

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableKeyMetadata extends KeyMetadata.AbstractKeyMetadata
Immutable implementation of KeyMetadata.AbstractKeyMetadata.

Use the builder to create immutable instances: ImmutableKeyMetadata.builder().

  • Method Details

    • platformIdentifier

      public String platformIdentifier()
      The unique identifier of the platform that can decode this secret.
      Returns:
      A String.
    • keyringIdentifier

      public String keyringIdentifier()
      The unique identifier of the keyring that holds the the private-key used to encrypt this encoded secret.
      Returns:
      A String.
    • keyIdentifier

      public String keyIdentifier()
      The unique identifier for the private-key used to encrypt this encoded secret.
      Returns:
      A String.
    • keyVersion

      public String keyVersion()
      The version of the encryption key used to encrypt this secret.
      Returns:
      A String.
    • keyPassword

      public Optional<String> keyPassword()
      An optional password that will unlock this particular key.
      Returns:
      An Optional of type String.
    • withPlatformIdentifier

      public final ImmutableKeyMetadata withPlatformIdentifier(String value)
      Copy the current immutable object by setting a value for the platformIdentifier attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for platformIdentifier
      Returns:
      A modified copy of the this object
    • withKeyringIdentifier

      public final ImmutableKeyMetadata withKeyringIdentifier(String value)
      Copy the current immutable object by setting a value for the keyringIdentifier attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for keyringIdentifier
      Returns:
      A modified copy of the this object
    • withKeyIdentifier

      public final ImmutableKeyMetadata withKeyIdentifier(String value)
      Copy the current immutable object by setting a value for the keyIdentifier attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for keyIdentifier
      Returns:
      A modified copy of the this object
    • withKeyVersion

      public final ImmutableKeyMetadata withKeyVersion(String value)
      Copy the current immutable object by setting a value for the keyVersion attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for keyVersion
      Returns:
      A modified copy of the this object
    • withKeyPassword

      public final ImmutableKeyMetadata withKeyPassword(String value)
      Copy the current immutable object by setting a present value for the optional keyPassword attribute.
      Parameters:
      value - The value for keyPassword
      Returns:
      A modified copy of this object
    • withKeyPassword

      public final ImmutableKeyMetadata withKeyPassword(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the keyPassword attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for keyPassword
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableKeyMetadata that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: platformIdentifier, keyringIdentifier, keyIdentifier, keyVersion, keyPassword.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value KeyMetadata with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableKeyMetadata copyOf(KeyMetadata.AbstractKeyMetadata instance)
      Creates an immutable copy of a KeyMetadata.AbstractKeyMetadata 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 KeyMetadata instance
    • builder

      public static ImmutableKeyMetadata.Builder builder()
      Creates a builder for ImmutableKeyMetadata.
       ImmutableKeyMetadata.builder()
          .platformIdentifier(String) // required platformIdentifier
          .keyringIdentifier(String) // required keyringIdentifier
          .keyIdentifier(String) // required keyIdentifier
          .keyVersion(String) // required keyVersion
          .keyPassword(String) // optional keyPassword
          .build();
       
      Returns:
      A new ImmutableKeyMetadata builder