Package org.ldk.structs
Class PositiveTimestamp
- java.lang.Object
-
- org.ldk.structs.PositiveTimestamp
-
public class PositiveTimestamp extends Object
A timestamp that refers to a date after 1 January 1970 which means its representation as UNIX timestamp is positive. # Invariants The UNIX timestamp representing the stored time has to be positive and small enough so that a `EpiryTime` can be added to it without an overflow.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
as_time()
Returns a reference to the internal `SystemTime` time representationlong
as_unix_timestamp()
Returns the UNIX timestamp representing the stored timePositiveTimestamp
clone()
Creates a copy of the PositiveTimestampboolean
eq(PositiveTimestamp b)
Checks if two PositiveTimestamps contain equal inner contents.protected void
finalize()
static Result_PositiveTimestampCreationErrorZ
from_system_time(long time)
Create a new `PositiveTimestamp` from a `SystemTime` with a corresponding unix timestamp in the Range `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a `CreationError::TimestampOutOfBounds`.static Result_PositiveTimestampCreationErrorZ
from_unix_timestamp(long unix_seconds)
Create a new `PositiveTimestamp` from a unix timestamp in the Range `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a `CreationError::TimestampOutOfBounds`.
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
eq
public boolean eq(PositiveTimestamp b)
Checks if two PositiveTimestamps 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.
-
clone
public PositiveTimestamp clone()
Creates a copy of the PositiveTimestamp
-
from_unix_timestamp
public static Result_PositiveTimestampCreationErrorZ from_unix_timestamp(long unix_seconds)
Create a new `PositiveTimestamp` from a unix timestamp in the Range `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a `CreationError::TimestampOutOfBounds`.
-
from_system_time
public static Result_PositiveTimestampCreationErrorZ from_system_time(long time)
Create a new `PositiveTimestamp` from a `SystemTime` with a corresponding unix timestamp in the Range `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a `CreationError::TimestampOutOfBounds`.
-
as_unix_timestamp
public long as_unix_timestamp()
Returns the UNIX timestamp representing the stored time
-
as_time
public long as_time()
Returns a reference to the internal `SystemTime` time representation
-
-