Class ImmutableLedgerHeader.Builder

java.lang.Object
org.xrpl.xrpl4j.model.ledger.ImmutableLedgerHeader.Builder
Enclosing class:
ImmutableLedgerHeader

@NotThreadSafe public static final class ImmutableLedgerHeader.Builder extends Object
Builds instances of type ImmutableLedgerHeader. 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 Details

    • from

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder from(LedgerHeader instance)
      Fill a builder with attribute values from the provided LedgerHeader instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • ledgerIndex

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder ledgerIndex(LedgerIndex ledgerIndex)
      Initializes the value for the ledgerIndex attribute.
      Parameters:
      ledgerIndex - The value for ledgerIndex
      Returns:
      this builder for use in a chained invocation
    • ledgerHash

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder ledgerHash(Hash256 ledgerHash)
      Initializes the optional value ledgerHash to ledgerHash.
      Parameters:
      ledgerHash - The value for ledgerHash
      Returns:
      this builder for chained invocation
    • ledgerHash

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder ledgerHash(Optional<? extends Hash256> ledgerHash)
      Initializes the optional value ledgerHash to ledgerHash.
      Parameters:
      ledgerHash - The value for ledgerHash
      Returns:
      this builder for use in a chained invocation
    • accountHash

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder accountHash(Hash256 accountHash)
      Initializes the optional value accountHash to accountHash.
      Parameters:
      accountHash - The value for accountHash
      Returns:
      this builder for chained invocation
    • accountHash

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder accountHash(Optional<? extends Hash256> accountHash)
      Initializes the optional value accountHash to accountHash.
      Parameters:
      accountHash - The value for accountHash
      Returns:
      this builder for use in a chained invocation
    • closeTime

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder closeTime(com.google.common.primitives.UnsignedLong closeTime)
      Initializes the optional value closeTime to closeTime.
      Parameters:
      closeTime - The value for closeTime
      Returns:
      this builder for chained invocation
    • closeTime

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder closeTime(Optional<? extends com.google.common.primitives.UnsignedLong> closeTime)
      Initializes the optional value closeTime to closeTime.
      Parameters:
      closeTime - The value for closeTime
      Returns:
      this builder for use in a chained invocation
    • closeTimeHuman

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder closeTimeHuman(ZonedDateTime closeTimeHuman)
      Initializes the optional value closeTimeHuman to closeTimeHuman.
      Parameters:
      closeTimeHuman - The value for closeTimeHuman
      Returns:
      this builder for chained invocation
    • closeTimeHuman

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder closeTimeHuman(Optional<? extends ZonedDateTime> closeTimeHuman)
      Initializes the optional value closeTimeHuman to closeTimeHuman.
      Parameters:
      closeTimeHuman - The value for closeTimeHuman
      Returns:
      this builder for use in a chained invocation
    • closed

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder closed(boolean closed)
      Initializes the value for the closed attribute.

      If not set, this attribute will have a default value as returned by the initializer of closed.

      Parameters:
      closed - The value for closed
      Returns:
      this builder for use in a chained invocation
    • parentHash

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder parentHash(Hash256 parentHash)
      Initializes the value for the parentHash attribute.
      Parameters:
      parentHash - The value for parentHash
      Returns:
      this builder for use in a chained invocation
    • parentCloseTime

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder parentCloseTime(com.google.common.primitives.UnsignedLong parentCloseTime)
      Initializes the optional value parentCloseTime to parentCloseTime.
      Parameters:
      parentCloseTime - The value for parentCloseTime
      Returns:
      this builder for chained invocation
    • parentCloseTime

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder parentCloseTime(Optional<? extends com.google.common.primitives.UnsignedLong> parentCloseTime)
      Initializes the optional value parentCloseTime to parentCloseTime.
      Parameters:
      parentCloseTime - The value for parentCloseTime
      Returns:
      this builder for use in a chained invocation
    • totalCoins

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder totalCoins(XrpCurrencyAmount totalCoins)
      Initializes the optional value totalCoins to totalCoins.
      Parameters:
      totalCoins - The value for totalCoins
      Returns:
      this builder for chained invocation
    • totalCoins

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder totalCoins(Optional<? extends XrpCurrencyAmount> totalCoins)
      Initializes the optional value totalCoins to totalCoins.
      Parameters:
      totalCoins - The value for totalCoins
      Returns:
      this builder for use in a chained invocation
    • transactionHash

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder transactionHash(Hash256 transactionHash)
      Initializes the optional value transactionHash to transactionHash.
      Parameters:
      transactionHash - The value for transactionHash
      Returns:
      this builder for chained invocation
    • transactionHash

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder transactionHash(Optional<? extends Hash256> transactionHash)
      Initializes the optional value transactionHash to transactionHash.
      Parameters:
      transactionHash - The value for transactionHash
      Returns:
      this builder for use in a chained invocation
    • addTransactions

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder addTransactions(TransactionResult<? extends Transaction> element)
      Adds one element to transactions list.
      Parameters:
      element - A transactions element
      Returns:
      this builder for use in a chained invocation
    • addTransactions

      @CanIgnoreReturnValue @SafeVarargs public final ImmutableLedgerHeader.Builder addTransactions(TransactionResult<? extends Transaction>... elements)
      Adds elements to transactions list.
      Parameters:
      elements - An array of transactions elements
      Returns:
      this builder for use in a chained invocation
    • transactions

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder transactions(Iterable<? extends TransactionResult<? extends Transaction>> elements)
      Sets or replaces all elements for transactions list.
      Parameters:
      elements - An iterable of transactions elements
      Returns:
      this builder for use in a chained invocation
    • addAllTransactions

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder addAllTransactions(Iterable<? extends TransactionResult<? extends Transaction>> elements)
      Adds elements to transactions list.
      Parameters:
      elements - An iterable of transactions elements
      Returns:
      this builder for use in a chained invocation
    • closeTimeResolution

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder closeTimeResolution(com.google.common.primitives.UnsignedInteger closeTimeResolution)
      Initializes the optional value closeTimeResolution to closeTimeResolution.
      Parameters:
      closeTimeResolution - The value for closeTimeResolution
      Returns:
      this builder for chained invocation
    • closeTimeResolution

      @CanIgnoreReturnValue public final ImmutableLedgerHeader.Builder closeTimeResolution(Optional<? extends com.google.common.primitives.UnsignedInteger> closeTimeResolution)
      Initializes the optional value closeTimeResolution to closeTimeResolution.
      Parameters:
      closeTimeResolution - The value for closeTimeResolution
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableLedgerHeader build()
      Builds a new ImmutableLedgerHeader.
      Returns:
      An immutable instance of LedgerHeader
      Throws:
      IllegalStateException - if any required attributes are missing