Class ImmutablePathStep

java.lang.Object
org.xrpl.xrpl4j.model.transactions.ImmutablePathStep
All Implemented Interfaces:
PathStep

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutablePathStep extends Object implements PathStep
Immutable implementation of PathStep.

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

  • Method Details

    • account

      public Optional<Address> account()
      If present, this PathStep represents rippling through the specified Address. MUST NOT be provided if this PathStep specifies the PathStep.currency() or PathStep.issuer() fields.
      Specified by:
      account in interface PathStep
      Returns:
      An Optional of type Address.
    • currency

      public Optional<String> currency()
      If present, this PathStep represents changing currencies through an order book. The currency specified indicates the new currency. MUST NOT be provided if this PathStep specifies the PathStep.account() field.
      Specified by:
      currency in interface PathStep
      Returns:
      An Optional of type String containing the currency code.
    • issuer

      public Optional<Address> issuer()
      If present, this path step represents changing currencies and this address defines the issuer of the new currency. If omitted in a step with a non-XRP currency, a previous step of the path defines the issuer. If present when currency is omitted, indicates a path step that uses an order book between same-named currencies with different issuers. MUST be omitted if the currency is XRP. MUST NOT be provided if this step specifies the PathStep.account() field.
      Specified by:
      issuer in interface PathStep
      Returns:
      The Optional Address of the currency issuer.
    • withAccount

      public final ImmutablePathStep withAccount(Address value)
      Copy the current immutable object by setting a present value for the optional account attribute.
      Parameters:
      value - The value for account
      Returns:
      A modified copy of this object
    • withAccount

      public final ImmutablePathStep withAccount(Optional<? extends Address> optional)
      Copy the current immutable object by setting an optional value for the account attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for account
      Returns:
      A modified copy of this object
    • withCurrency

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

      public final ImmutablePathStep withCurrency(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the currency 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 currency
      Returns:
      A modified copy of this object
    • withIssuer

      public final ImmutablePathStep withIssuer(Address value)
      Copy the current immutable object by setting a present value for the optional issuer attribute.
      Parameters:
      value - The value for issuer
      Returns:
      A modified copy of this object
    • withIssuer

      public final ImmutablePathStep withIssuer(Optional<? extends Address> optional)
      Copy the current immutable object by setting an optional value for the issuer attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for issuer
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutablePathStep 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: account, currency, issuer.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutablePathStep copyOf(PathStep instance)
      Creates an immutable copy of a PathStep 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 PathStep instance
    • builder

      public static ImmutablePathStep.Builder builder()
      Creates a builder for ImmutablePathStep.
       ImmutablePathStep.builder()
          .account(Address) // optional account
          .currency(String) // optional currency
          .issuer(Address) // optional issuer
          .build();
       
      Returns:
      A new ImmutablePathStep builder