Skip to content

Commit 3073766

Browse files
committed
Make UUIDs communicable
1 parent 5db1f21 commit 3073766

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/core/inimitable.Uuid.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import java.util as ju
2222

2323
import anticipation.*
2424
import vacuous.*
25+
import fulminate.*
2526
import rudiments.*
2627
import contingency.*
2728

@@ -35,6 +36,8 @@ object Uuid extends Extractor[Text, Uuid]:
3536
def apply(): Uuid = ju.UUID.randomUUID().nn.pipe: uuid =>
3637
Uuid(uuid.getMostSignificantBits, uuid.getLeastSignificantBits)
3738

39+
given Uuid is Communicable = uuid => Message(uuid.text)
40+
3841
case class Uuid(msb: Long, lsb: Long):
3942
def java: ju.UUID = ju.UUID(msb, lsb)
4043
def text: Text = this.java.toString.tt

0 commit comments

Comments
 (0)