Class ImmutableVoteEntry

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableVoteEntry
All Implemented Interfaces:
VoteEntry

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

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

  • Method Details

    • account

      public Address account()
      The address of the LP who voted.
      Specified by:
      account in interface VoteEntry
      Returns:
      An Address.
    • tradingFee

      public TradingFee tradingFee()
      The trading fee that the LP voted for.
      Specified by:
      tradingFee in interface VoteEntry
      Returns:
      A TradingFee.
    • voteWeight

      public VoteWeight voteWeight()
      The weight of the LP's vote.
      Specified by:
      voteWeight in interface VoteEntry
      Returns:
      The VoteWeight.
    • withAccount

      public final ImmutableVoteEntry withAccount(Address value)
      Copy the current immutable object by setting a value for the account attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for account
      Returns:
      A modified copy of the this object
    • withTradingFee

      public final ImmutableVoteEntry withTradingFee(TradingFee value)
      Copy the current immutable object by setting a value for the tradingFee attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for tradingFee
      Returns:
      A modified copy of the this object
    • withVoteWeight

      public final ImmutableVoteEntry withVoteWeight(VoteWeight value)
      Copy the current immutable object by setting a value for the voteWeight attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for voteWeight
      Returns:
      A modified copy of the this object
    • equals

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

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

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

      public static ImmutableVoteEntry.Builder builder()
      Creates a builder for ImmutableVoteEntry.
       ImmutableVoteEntry.builder()
          .account(org.xrpl.xrpl4j.model.transactions.Address) // required account
          .tradingFee(org.xrpl.xrpl4j.model.transactions.TradingFee) // required tradingFee
          .voteWeight(org.xrpl.xrpl4j.model.transactions.VoteWeight) // required voteWeight
          .build();
       
      Returns:
      A new ImmutableVoteEntry builder