Conversion
Purpose¶
A general purpose conversion utilities.
Methods¶
Binding name: p6.conversion
getBytesFromUUID¶
Convert an UUID to a byte array.
Syntax
byte[] p6.conversion.getBytesFromUUID(UUID uuid)
Example
def uuid = UUID.randomUUID()
def bytes = p6.conversion.getBytesFromUUID(uuid)
getUUIDFromBytes¶
Convert a byte array to an UUID.
Syntax
UUID p6.conversion.getUUIDFromBytes(byte[] bytes)
Example
def uuid = p6.conversion.getUUIDFromBytes(bytes)
bigIntegerToZDT¶
Convert an epoch (in millisec) to a date time.
Syntax
ZonedDateTime p6.conversion.bigIntegerToZDT(BigInteger epoch)
Example
def epoch = 1550160528000
def zdt = p6.conversion.bigIntegerToZDT(epoch)
zdtToBigInteger¶
Convert a date time to epoch (in millisec).
Syntax
BigInteger p6.conversion.zdtToBigInteger(ZonedDateTime zdt)
Example
def epoch = p6.conversion.zdtToBigInteger(zdt)