panamarest.blogg.se

Java uuid generator jug
Java uuid generator jug













  1. #Java uuid generator jug generator
  2. #Java uuid generator jug license

UUID values are often passed as java Strings or bytes (byte arrays),Īnd conversion is needed to get to actual instances. UUIDUtil.toByteArray(uuid, outputBuffer, 100) Ĭonstructing values from String, byte Sometimes you may want to convert from into external serialization:įor example, as Strings or byte arrays ( byte).Ĭonversion to String is easy with UUID.toString() (provided by JDK), but there is no similar functionality for converting into byte.īut UUIDUtil class provides methods for efficient conversions: byte asBytes = UUIDUtil.asByteArray(uuid) Javadocs for further information can be found from Project Wiki. Generators are fully thread-safe, so a single instance may be shared among multiple threads.

#Java uuid generator jug generator

If you want customize generators, you may also just want to hold on to generator instance: TimeBasedGenerator gen = Generators.timeBasedGenerator(omInterface()) UUID uuid = Generators.timeBasedEpochGenerator().generate() // Variant 7 UUID uuid = Generators.timeBasedReorderedGenerator().generate() // Variant 6 With JUG 4.1+: support for variants 6 and 7: UUID uuid = Generators.nameBasedgenerator().generate("string to hash") // Variant 5 UUID uuid = Generators.randomBasedGenerator().generate() // Variant 4 This is done by first selecting a kind of generator to use, and then calling its generate() method.įor example: UUID uuid = Generators.timeBasedGenerator().generate() // Variant 1 The original use case for JUG was generation of UUID values. Downloadsįor direct downloads, check out Project Wiki. Since version 3.2.0, JUG defines JDK9+ compatible module-info.class, with module name of.

java uuid generator jug

For versions 4.x and up, slf4j API is used: logging implementation to be provided by calling application.

java uuid generator jug

  • For versions up to 3.x, log4j is used, optionally (runtime dependency).
  • The only dependency for JUG is the logging library: JUG can be used as a command-line tool (via class ),

    java uuid generator jug

    #Java uuid generator jug license

    JUG is licensed under Apache License 2.0. In addition, many other individuals have helped fix bugs and implement new features: please see release-notes/CREDITS for the complete list. JUG was written by Tatu Saloranta ( ) originally in 2002 and has been updated over the years. (also see Wikipedia UUID page for more explanation) It generates UUIDs according to the UUID specification (RFC-4122) JUG is a set of Java classes for working with UUIDs: generating UUIDs using any of standard methods, outputting















    Java uuid generator jug