package uuid
This package holds the optimized Scala wrapper for java.util.UUID.
To use the wrapper, either extend the Imports trait or import this package object to bring the implicit into scope that way:
scala> import io.jvm.uuid._ import io.jvm.uuid._ scala> val foo = classOf[UUID] foo: Class[io.jvm.uuid.UUID] = class java.util.UUID scala> val bar = UUID(1, 2) bar: io.jvm.uuid.UUID = 00000000-0000-0001-0000-000000000002 scala> val UUID(baz) = "00112233-4455-6677-8899-aAbBcCdDeEfF" baz: io.jvm.uuid.UUID = 00112233-4455-6677-8899-aabbccddeeff
- Source
- package.scala
- Alphabetic
- By Inheritance
- uuid
- Imports
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- trait Imports extends AnyRef
This trait holds all the components required for completing the pimp-my-library pattern:
This trait holds all the components required for completing the pimp-my-library pattern:
- an
UUIDtype alias - an
UUIDsingleton object with static forwarders and newUUIDfactories - an implicit def to provide extensions on the legacy
java.util.UUIDclass
Use case is to use it by extending it with your package object:
package com package object example extends io.jvm.uuid.Imports
Now any class in the
com.examplepackage will be able to access richUUIDfunctionality:package com.example class User(val id: UUID = UUID.random)
- an
- final class RichUUID extends AnyVal with Ordered[UUID]
Pimp-my-library pattern, wrapping the underlying
java.util.UUID. - class StaticUUID extends AnyRef
This class holds all static forwarders and
UUIDfactories.This class holds all static forwarders and
UUIDfactories.Extend this class from the client code in order to add new functionality to the library.
- final type UUID = java.util.UUID
- Definition Classes
- Imports
Value Members
- final val UUID: StaticUUID
- Definition Classes
- Imports
- implicit final def toRichUUID(uuid: UUID): RichUUID
- Definition Classes
- Imports
- object StaticUUID extends StaticUUID
Singleton object to be bound with the
UUIDvalue in the package object.