author | wenzelm |
Sat, 31 Jul 2021 15:44:11 +0200 | |
changeset 74094 | 6113f1db4342 |
parent 73133 | 497e11537d48 |
child 75393 | 87ebf5a50283 |
permissions | -rw-r--r-- |
/* Title: Pure/General/uuid.scala Author: Makarius Universally unique identifiers. */ package isabelle object UUID { type T = java.util.UUID def random(): T = java.util.UUID.randomUUID() def unapply(s: String): Option[T] = try { Some(java.util.UUID.fromString(s)) } catch { case _: IllegalArgumentException => None } def unapply(body: XML.Body): Option[T] = unapply(XML.content(body)) }