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
- Source
- UUID.scala
- Alphabetic
- By Inheritance
- UUID
- Serializable
- Product
- Equals
- Ordered
- Comparable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def <(that: UUID): Boolean
- Definition Classes
- Ordered
- def <=(that: UUID): Boolean
- Definition Classes
- Ordered
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def >(that: UUID): Boolean
- Definition Classes
- Ordered
- def >=(that: UUID): Boolean
- Definition Classes
- Ordered
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def compare(that: UUID): Int
- Definition Classes
- UUID → Ordered
- def compareTo(that: UUID): Int
- Definition Classes
- Ordered → Comparable
- def counter: Int
Between 0 and 65535 (both inclusive)
- def date: ImmutableDate
The fm.common.ImmutableDate represented by the epochMilli
- def epochMilli: Long
Between 0 and 281474976710655 (both inclusive) which is a 6-byte unsigned int
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def instant: Instant
The java.time.Instant represented by the epochMilli
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isRandomNodeId: Boolean
Is this UUID using a random node id?
- def isSignedMaxValue: Boolean
- def isSignedMinValue: Boolean
- def isUnsignedMaxValue: Boolean
- def isZero: Boolean
- def javaDate: Date
The java.util.Date represented by the epochMilli
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nodeId: Int
Between Short.MinValue (-32768) and Short.MaxValue (32767) (both inclusive)
- val nodeIdAndRandom: Long
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def random: Long
Between 0 and 281474976710655 (both inclusive) which is a 6-byte unsigned int
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val timeAndCounter: Long
- def toBase16(): String
- def toBase58(): String
- def toBase64(): String
- def toBase64NoPadding(): String
- def toBase64URL(): String
- def toBase64URLNoPadding(): String
- def toBigInt: BigInt
- def toBigInteger: BigInteger
- def toByteArray(): Array[Byte]
- def toHex(): String
- def toImmutableByteArray(): ImmutableArray[Byte]
- def toJavaUUID: java.util.UUID
- def toPrettyString(sep: Char): String
{6-byte millis since epoch}{sep}{2-byte-counter}{sep}{2-byte-optional-node-id}{sep}{4-byte-random}
- def toPrettyString(): String
{6-byte millis since epoch}-{2-byte-counter}-{2-byte-optional-node-id}-{4-byte-random}
- def toStandardString(sep: Char): String
{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}
- def toStandardString(): String
{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}
- def toString(): String
- Definition Classes
- UUID → AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])