Class Guid
java.lang.Object
com.pnfsoftware.jeb.core.units.code.wincommon.Guid
GUID - 128-bit UUID objects. Default rendering performs Microsoft-style decoding by default.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()static GuidParse a GUID string.static Guidparse(ByteBuffer b) Parse a GUID from a byte buffer.static Guidrandom()Generate a random GUID.toString()Microsoft-style decoding.toString(boolean microsoftStyleDecoding, boolean useSeparators, boolean useBrackets) Format this GUID.
-
Constructor Details
-
Guid
public Guid(byte[] data, int offset) Create a GUID from a 16-byte slice.- Parameters:
data- source bytesoffset- offset of the first GUID byte
-
Guid
public Guid(byte[] data) Create a GUID from the first 16 bytes of an array.- Parameters:
data- source bytes
-
Guid
public Guid(byte[] data, boolean nocopy) Create a GUID from a byte array.- Parameters:
data- source bytesnocopy- true to keepdataas the backing array; false to copy the first 16 bytes
-
-
Method Details
-
parse
Parse a GUID from a byte buffer.- Parameters:
b- buffer positioned at the GUID bytes- Returns:
- a GUID object
-
parse
Parse a GUID string.- Parameters:
s- GUID string, with optional dashes and bracesmicrosoftStyleEncoding- true if the text uses Microsoft's mixed-endian field encoding- Returns:
- a GUID object
-
random
Generate a random GUID.- Returns:
- a random GUID object
-
hashCode
public int hashCode() -
equals
-
toString
Microsoft-style decoding. -
toString
Format this GUID.- Parameters:
microsoftStyleDecoding- true to decode the first fields as little-endian valuesuseSeparators- true to insert dash separatorsuseBrackets- true to wrap the text in braces- Returns:
- the formatted GUID
-