com.fasterxml.uuid.impl
Class UUIDUtil

java.lang.Object
  extended by com.fasterxml.uuid.impl.UUIDUtil

public class UUIDUtil
extends Object


Field Summary
static int BYTE_OFFSET_CLOCK_HI
           
static int BYTE_OFFSET_CLOCK_LO
           
static int BYTE_OFFSET_CLOCK_MID
           
static int BYTE_OFFSET_CLOCK_SEQUENCE
           
static int BYTE_OFFSET_TYPE
           
static int BYTE_OFFSET_VARIATION
           
 
Constructor Summary
UUIDUtil()
           
 
Method Summary
static byte[] asByteArray(UUID uuid)
           
static UUID constructUUID(UUIDType type, byte[] uuidBytes)
          Helper method for constructing UUID instances with appropriate type
static UUID constructUUID(UUIDType type, long l1, long l2)
           
protected static long gatherLong(byte[] buffer, int offset)
           
static long initUUIDFirstLong(long l1, int rawType)
           
static long initUUIDFirstLong(long l1, UUIDType type)
           
static long initUUIDSecondLong(long l2)
           
static void toByteArray(UUID uuid, byte[] buffer)
           
static void toByteArray(UUID uuid, byte[] buffer, int offset)
           
static UUIDType typeOf(UUID uuid)
          Method for determining which type of UUID given UUID is.
static UUID uuid(byte[] bytes)
          Factory method for constructing UUID instance from given 16 bytes.
static UUID uuid(byte[] bytes, int offset)
          Factory method for constructing UUID instance from given 16 bytes.
static UUID uuid(String id)
          Factory method for creating UUIDs from the canonical string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BYTE_OFFSET_CLOCK_LO

public static final int BYTE_OFFSET_CLOCK_LO
See Also:
Constant Field Values

BYTE_OFFSET_CLOCK_MID

public static final int BYTE_OFFSET_CLOCK_MID
See Also:
Constant Field Values

BYTE_OFFSET_CLOCK_HI

public static final int BYTE_OFFSET_CLOCK_HI
See Also:
Constant Field Values

BYTE_OFFSET_TYPE

public static final int BYTE_OFFSET_TYPE
See Also:
Constant Field Values

BYTE_OFFSET_CLOCK_SEQUENCE

public static final int BYTE_OFFSET_CLOCK_SEQUENCE
See Also:
Constant Field Values

BYTE_OFFSET_VARIATION

public static final int BYTE_OFFSET_VARIATION
See Also:
Constant Field Values
Constructor Detail

UUIDUtil

public UUIDUtil()
Method Detail

uuid

public static UUID uuid(String id)
Factory method for creating UUIDs from the canonical string representation.

Parameters:
id - String that contains the canonical representation of the UUID to build; 36-char string (see UUID specs for details). Hex-chars may be in upper-case too; UUID class will always output them in lowercase.

uuid

public static UUID uuid(byte[] bytes)
Factory method for constructing UUID instance from given 16 bytes. NOTE: since absolutely no validation is done for contents, this method should only be used if contents are known to be valid.


uuid

public static UUID uuid(byte[] bytes,
                        int offset)
Factory method for constructing UUID instance from given 16 bytes. NOTE: since absolutely no validation is done for contents, this method should only be used if contents are known to be valid.

Parameters:
bytes - Array that contains sequence of 16 bytes that contain a valid UUID
offset - Offset of the first of 16 bytes

constructUUID

public static UUID constructUUID(UUIDType type,
                                 byte[] uuidBytes)
Helper method for constructing UUID instances with appropriate type


constructUUID

public static UUID constructUUID(UUIDType type,
                                 long l1,
                                 long l2)

initUUIDFirstLong

public static long initUUIDFirstLong(long l1,
                                     UUIDType type)

initUUIDFirstLong

public static long initUUIDFirstLong(long l1,
                                     int rawType)

initUUIDSecondLong

public static long initUUIDSecondLong(long l2)

typeOf

public static UUIDType typeOf(UUID uuid)
Method for determining which type of UUID given UUID is. Returns null if type can not be determined.

Parameters:
uuid - UUID to check
Returns:
Null if uuid is null or type can not be determined (== invalid UUID); otherwise type

asByteArray

public static byte[] asByteArray(UUID uuid)

toByteArray

public static void toByteArray(UUID uuid,
                               byte[] buffer)

toByteArray

public static void toByteArray(UUID uuid,
                               byte[] buffer,
                               int offset)

gatherLong

protected static final long gatherLong(byte[] buffer,
                                       int offset)


Copyright © 2011 FasterXML.com. All Rights Reserved.