ServiceUnits

@Serializable
value class ServiceUnits(val value: Long) : Comparable<ServiceUnits>

A non-negative quantity of service — the abstract unit the ledger accounts in (CPU-milliseconds, tasks, tokens; whatever the consumer meters). Always >= 0; a negative amount of service is meaningless and is rejected at construction rather than allowed to poison the tally.

Addition is overflow-checked (plus throws on Long overflow), so a running total can never silently wrap past Long.MAX_VALUE.

Constructors

Link copied to clipboard
constructor(value: Long)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val value: Long

Functions

Link copied to clipboard
open operator override fun compareTo(other: ServiceUnits): Int
Link copied to clipboard
operator fun plus(other: ServiceUnits): ServiceUnits

The overflow-checked sum of this and other.