Package org.ldk.structs
Class ExpiryTime
- java.lang.Object
-
- org.ldk.structs.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
as_duration()
Returns a reference to the underlying `Duration` (=expiry time)long
as_seconds()
Returns the expiry time in secondsExpiryTime
clone()
Creates a copy of the ExpiryTimeboolean
eq(ExpiryTime b)
Checks if two ExpiryTimes contain equal inner contents.protected void
finalize()
static Result_ExpiryTimeCreationErrorZ
from_duration(long duration)
Construct an `ExpiryTime` from a `Duration`.static Result_ExpiryTimeCreationErrorZ
from_seconds(long seconds)
Construct an `ExpiryTime` from seconds.long
hash()
Checks if two ExpiryTimes contain equal inner contents.
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
clone
public ExpiryTime clone()
Creates a copy of the ExpiryTime
-
hash
public long hash()
Checks if two ExpiryTimes contain equal inner contents.
-
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)
-
-