DefaultPreparedValue

data class DefaultPreparedValue<V>(val value: V, val ttlAt: Long = TTL_FOREVER) : PreparedValue<V>

Default implementation of PreparedValue that wraps a value with TTL information. This class provides a simple data structure for storing prepared values with optional expiration timestamps.

Parameters

V

the type of the prepared value

Constructors

Link copied to clipboard
constructor(value: V, ttlAt: Long = TTL_FOREVER)

Properties

Link copied to clipboard
open val isExpired: Boolean

Checks if this prepared value has expired. Permanent values (isForever = true) never expire. Temporary values expire when the current time exceeds ttlAt.

Link copied to clipboard
open val isForever: Boolean

Checks if this prepared value is permanent (never expires). A value is considered permanent if its ttlAt is greater than or equal to TTL_FOREVER.

Link copied to clipboard
open override val ttlAt: Long

the expiration timestamp in milliseconds since epoch (defaults to permanent)

Link copied to clipboard
open override val value: V

the actual value being prepared