Temporal

public interface Temporal<T extends Temporal<T>> implements Comparable<T>

A point in time represented with a certain accuracy.

The name of this interface is inspired by the java.time.temporal.Temporal.

Provides a default implementation for comparison of two points in time. It is not supposed that concrete Temporals would override this comparison mechanism.

Parameters

<T>

the type of itself

Functions

Link copied to clipboard
public int compareTo(T other)
public int compareTo(Timestamp other)
public int compareTo(Instant other)
Compares this point in time to the given one.
Link copied to clipboard
public boolean isAfter(T other)
public boolean isAfter(Timestamp other)
public boolean isAfter(Instant other)
Checks if this point is time occurs later than the other one.
Link copied to clipboard
public boolean isAfterOrSameAs(T other)
public boolean isAfterOrSameAs(Timestamp other)
public boolean isAfterOrSameAs(Instant other)
Checks if this point is time occurs later than the other one or they coincide.
Link copied to clipboard
public boolean isBefore(T other)
public boolean isBefore(Timestamp other)
public boolean isBefore(Instant other)
Checks if this point is time occurs earlier than the other one.
Link copied to clipboard
public boolean isBeforeOrSameAs(T other)
public boolean isBeforeOrSameAs(Timestamp other)
public boolean isBeforeOrSameAs(Instant other)
Checks if this point is time occurs earlier than the other one or they coincide.
Link copied to clipboard
public boolean isBetween(T periodStart, T periodEnd)
public boolean isBetween(Timestamp periodStart, Timestamp periodEnd)
public boolean isBetween(Instant periodStart, Instant periodEnd)
Checks if this point is time lies between the given.
Link copied to clipboard
public boolean isEarlierOrSameAs(T other)
Checks if this point is time occurs earlier than the other one or they coincide.
Link copied to clipboard
public boolean isEarlierThan(T other)
Checks if this point is time occurs earlier than the other one.
Link copied to clipboard
public boolean isInFuture()
Checks that this point in time lies in the future.
Link copied to clipboard
public boolean isInPast()
Checks that this point in time lies in the past.
Link copied to clipboard
public boolean isLaterOrSameAs(T other)
Checks if this point is time occurs later than the other one or they coincide.
Link copied to clipboard
public boolean isLaterThan(T other)
Checks if this point is time occurs later than the other one.
Link copied to clipboard
public boolean isSameAs(T other)
public boolean isSameAs(Timestamp other)
public boolean isSameAs(Instant other)
Checks if this point in time coincides with the given one.
Link copied to clipboard
public abstract Any toAny()
Packs this point in time into an Any.
Link copied to clipboard
public abstract Instant toInstant()
Converts this Temporal into a java.time.Instant.
Link copied to clipboard
public Timestamp toTimestamp()
Obtains this point in time as a Protobuf Timestamp.