Class TimeBounds

java.lang.Object
org.stellar.sdk.TimeBounds

public final class TimeBounds extends Object
TimeBounds represents the time interval that a transaction is valid.

The UNIX timestamp (in seconds), determined by ledger time, of a lower and upper bound of when this transaction will be valid. If a transaction is submitted too early or too late, it will fail to make it into the transaction set.

See Also:
  • Constructor Details

    • TimeBounds

      public TimeBounds(BigInteger minTime, BigInteger maxTime)
      Parameters:
      minTime - 64-bit Unix timestamp
      maxTime - 64-bit Unix timestamp
    • TimeBounds

      public TimeBounds(long minTime, long maxTime)
      Parameters:
      minTime - 64-bit Unix timestamp
      maxTime - 64-bit Unix timestamp
  • Method Details

    • expiresAfter

      public static TimeBounds expiresAfter(long timeout)
      A factory method that sets maxTime to the specified second from now.
      Parameters:
      timeout - Timeout in seconds.
      Returns:
      TimeBounds
    • fromXdr

      public static TimeBounds fromXdr(TimeBounds timeBounds)
      Construct a new TimeBounds object from a TimeBounds XDR object.
      Parameters:
      timeBounds - TimeBounds XDR object
      Returns:
      TimeBounds object
    • toXdr

      public TimeBounds toXdr()
      Returns:
      TimeBounds XDR object
    • getMinTime

      public BigInteger getMinTime()
      the UNIX timestamp (in seconds)
    • getMaxTime

      public BigInteger getMaxTime()
      the UNIX timestamp (in seconds)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object