gr.jkl.uid

Id

final class Id extends AnyVal

Value class of 64-bit Ids with underlying type of Long.

An Id instance doesn't know about the way it is structured. This depends on the Scheme of its Generator. So, the methods whiches extract parameters (e.g. timestamp, node and sequence) from an Id require an implicit Scheme. Consequently, those methods will return different results depending on the provided Scheme.

Generally, when an Id is constructed by a timestamp, a node and a sequence a Scheme is required. On the other hand, an Id can be constructed by a Long or a String without a Scheme.

Ids are sorted the same way as Ids, as Longs and as Strings. The default Ordering, implicit in the companion object, sorts Ids first by their timestamp, then by their node and then by their sequence.

Linear Supertypes
AnyVal, NotNull, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Id
  2. AnyVal
  3. NotNull
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Id(underlying: Long)

    underlying

    The Long behind this Id.

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  2. final def ##(): Int

    Definition Classes
    Any
  3. def <(that: Id): Boolean

    Returns true if this Id is less than the provided Id.

  4. def <=(that: Id): Boolean

    Returns true if this Id is less than or equal to the provided Id.

  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def >(that: Id): Boolean

    Returns true if this Id is greater than the provided Id.

  7. def >=(that: Id): Boolean

    Returns true if this Id is greater than or equal to the provided Id.

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def getClass(): Class[_ <: AnyVal]

    Definition Classes
    AnyVal → Any
  10. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  11. def node(implicit scheme: Scheme): Long

    Extracts the id of the node generated this Id.

  12. def sequence(implicit scheme: Scheme): Long

    Extracts the sequence of this Id.

  13. def timestamp(implicit scheme: Scheme): Long

    Extracts the timestamp of this Id.

  14. def toShortString: String

    Returns a shortened base64 like String representation of this Id.

  15. def toString(): String

    Returns a base64 like String representation of this Id.

    Returns a base64 like String representation of this Id.

    Definition Classes
    Id → Any
  16. def toTriple(implicit scheme: Scheme): (Long, Long, Long)

    Returns a tuple with the timestamp, the node and the sequence of this Id

  17. val underlying: Long

    The Long behind this Id.

Inherited from AnyVal

Inherited from NotNull

Inherited from Any

Ungrouped