Class/Object

fm.common

UUID

Related Docs: object UUID | package common

Permalink

final case class UUID(timeAndCounter: Long, nodeIdAndRandom: Long) extends Ordered[UUID] with Product with Serializable

A custom UUID implementation (not to be confused with java.util.UUID or RFC4122 implementations) that allows natural sorting by timestamp based on the string or numeric representation.

The UUID consists of 16 bytes (128 bits) broken up into 2 longs:

timeAndCounter: {6-Byte Millis since epoch}{2-Byte Counter} nodeIdAndRandom: {2-Byte Node ID}{6-Byte Random Number}

The "pretty" hex encoded representation is: {6-byte millis since epoch}-{2-byte-counter}-{2-byte-optional-node-id}-{4-byte-random}

Example: 015247f01787-9740-85e0-3e9672a8dfa2

Linear Supertypes
Serializable, Serializable, Product, Equals, Ordered[UUID], Comparable[UUID], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. UUID
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Ordered
  7. Comparable
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new UUID(timeAndCounter: Long, nodeIdAndRandom: Long)

    Permalink

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. def <(that: UUID): Boolean

    Permalink
    Definition Classes
    Ordered
  4. def <=(that: UUID): Boolean

    Permalink
    Definition Classes
    Ordered
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. def >(that: UUID): Boolean

    Permalink
    Definition Classes
    Ordered
  7. def >=(that: UUID): Boolean

    Permalink
    Definition Classes
    Ordered
  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  10. def compare(that: UUID): Int

    Permalink
    Definition Classes
    UUID → Ordered
  11. def compareTo(that: UUID): Int

    Permalink
    Definition Classes
    Ordered → Comparable
  12. def counter: Int

    Permalink

    Between 0 and 65535 (both inclusive)

  13. def date: ImmutableDate

    Permalink

    The fm.common.ImmutableDate represented by the epochMilli

  14. def epochMilli: Long

    Permalink

    Between 0 and 281474976710655 (both inclusive) which is a 6-byte unsigned int

  15. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  17. def instant: Instant

    Permalink

    The java.time.Instant represented by the epochMilli

  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. def isRandomNodeId: Boolean

    Permalink

    Is this UUID using a random node id?

  20. def isSignedMaxValue: Boolean

    Permalink
  21. def isSignedMinValue: Boolean

    Permalink
  22. def isUnsignedMaxValue: Boolean

    Permalink
  23. def isZero: Boolean

    Permalink
  24. def javaDate: Date

    Permalink

    The java.util.Date represented by the epochMilli

  25. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  26. def nodeId: Int

    Permalink

    Between Short.MinValue (-32768) and Short.MaxValue (32767) (both inclusive)

  27. val nodeIdAndRandom: Long

    Permalink
  28. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  29. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  30. def random: Long

    Permalink

    Between 0 and 281474976710655 (both inclusive) which is a 6-byte unsigned int

  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  32. val timeAndCounter: Long

    Permalink
  33. def toBase16: String

    Permalink
  34. def toBase58: String

    Permalink
  35. def toBase64: String

    Permalink
  36. def toBase64NoPadding: String

    Permalink
  37. def toBase64URL: String

    Permalink
  38. def toBase64URLNoPadding: String

    Permalink
  39. def toBigInt: BigInt

    Permalink
  40. def toBigInteger: BigInteger

    Permalink
  41. def toByteArray(): Array[Byte]

    Permalink
  42. def toHex: String

    Permalink
  43. def toImmutableByteArray(): ImmutableArray[Byte]

    Permalink
  44. def toJavaUUID: java.util.UUID

    Permalink
  45. def toPrettyString(sep: Char): String

    Permalink

    {6-byte millis since epoch}{sep}{2-byte-counter}{sep}{2-byte-optional-node-id}{sep}{4-byte-random}

  46. def toPrettyString(): String

    Permalink

    {6-byte millis since epoch}-{2-byte-counter}-{2-byte-optional-node-id}-{4-byte-random}

  47. def toStandardString(sep: Char): String

    Permalink

    {upper 4-bytes of 6-byte millis since epoch}{sep}{lower 2-bytes of 6-byte millis since epoch}{sep}{2-byte-counter}{sep}{2-byte-optional-node-id}{sep}{4-byte-random}

  48. def toStandardString(): String

    Permalink

    {upper 4-bytes of 6-byte millis since epoch}-{lower 2-bytes of 6-byte millis since epoch}-{2-byte-counter}-{2-byte-optional-node-id}-{4-byte-random}

  49. def toString(): String

    Permalink
    Definition Classes
    UUID → AnyRef → Any
  50. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  52. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Ordered[UUID]

Inherited from Comparable[UUID]

Inherited from AnyRef

Inherited from Any

Ungrouped