public final class TimeRange


A range of time, that may be unbounded on either side.

Summary

Public fields

static final @NonNull TimeRange

The TimeRange that includes every point in time.

Public methods

static final @NonNull TimeRange
after(@NonNull Instant startInstant)

Constructs a time range after a given point in time.

static final @NonNull TimeRange
before(@NonNull Instant endInstant)

Constructs a time range until a given point in time.

static final @NonNull TimeRange
between(@NonNull Instant startInstant, @NonNull Instant endInstant)

Constructs a time range between two points in time, inclusive of the points themselves.

final boolean
contains(@NonNull Instant dateTimeMillis)

Returns whether the TimeRange contains a given point in time.

boolean
equals(Object other)
final @NonNull Instant
final @NonNull Instant
int
@NonNull String

Public fields

ALWAYS

public static final @NonNull TimeRange ALWAYS

The TimeRange that includes every point in time.

Public methods

after

Added in 1.0.0
public static final @NonNull TimeRange after(@NonNull Instant startInstant)

Constructs a time range after a given point in time.

before

Added in 1.0.0
public static final @NonNull TimeRange before(@NonNull Instant endInstant)

Constructs a time range until a given point in time.

between

Added in 1.0.0
public static final @NonNull TimeRange between(@NonNull Instant startInstant, @NonNull Instant endInstant)

Constructs a time range between two points in time, inclusive of the points themselves.

contains

Added in 1.0.0
public final boolean contains(@NonNull Instant dateTimeMillis)

Returns whether the TimeRange contains a given point in time.

equals

public boolean equals(Object other)

getEndDateTimeMillis

Added in 1.0.0
public final @NonNull Instant getEndDateTimeMillis()

getStartDateTimeMillis

Added in 1.0.0
public final @NonNull Instant getStartDateTimeMillis()

hashCode

public int hashCode()

toString

public @NonNull String toString()