Class ExpiryTime


  • public class ExpiryTime
    extends Object
    Positive duration that defines when (relatively to the timestamp) in the future the invoice expires # Invariants The number of seconds this expiry time represents has to be in the range `0...(SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME)` to avoid overflows when adding it to a timestamp
    • Method Detail

      • eq

        public boolean eq​(ExpiryTime b)
        Checks if two ExpiryTimes contain equal inner contents. This ignores pointers and is_owned flags and looks at the values in fields. Two objects with NULL inner values will be considered "equal" here.
      • from_seconds

        public static Result_ExpiryTimeCreationErrorZ from_seconds​(long seconds)
        Construct an `ExpiryTime` from seconds. If there exists a `PositiveTimestamp` which would overflow on adding the `EpiryTime` to it then this function will return a `CreationError::ExpiryTimeOutOfBounds`.
      • from_duration

        public static Result_ExpiryTimeCreationErrorZ from_duration​(long duration)
        Construct an `ExpiryTime` from a `Duration`. If there exists a `PositiveTimestamp` which would overflow on adding the `EpiryTime` to it then this function will return a `CreationError::ExpiryTimeOutOfBounds`.
      • as_seconds

        public long as_seconds()
        Returns the expiry time in seconds
      • as_duration

        public long as_duration()
        Returns a reference to the underlying `Duration` (=expiry time)