java.lang.Object
com.pnfsoftware.jeb.core.units.code.wincommon.Guid

@Ser public class Guid extends Object
GUID - 128-bit UUID objects. Default rendering performs Microsoft-style decoding by default.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Guid(byte[] data)
    Create a GUID from the first 16 bytes of an array.
    Guid(byte[] data, boolean nocopy)
    Create a GUID from a byte array.
    Guid(byte[] data, int offset)
    Create a GUID from a 16-byte slice.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
     
    static Guid
    parse(String s, boolean microsoftStyleEncoding)
    Parse a GUID string.
    static Guid
    Parse a GUID from a byte buffer.
    static Guid
    Generate a random GUID.
    Microsoft-style decoding.
    toString(boolean microsoftStyleDecoding, boolean useSeparators, boolean useBrackets)
    Format this GUID.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Guid

      public Guid(byte[] data, int offset)
      Create a GUID from a 16-byte slice.
      Parameters:
      data - source bytes
      offset - 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 bytes
      nocopy - true to keep data as the backing array; false to copy the first 16 bytes
  • Method Details

    • parse

      public static Guid parse(ByteBuffer b)
      Parse a GUID from a byte buffer.
      Parameters:
      b - buffer positioned at the GUID bytes
      Returns:
      a GUID object
    • parse

      public static Guid parse(String s, boolean microsoftStyleEncoding)
      Parse a GUID string.
      Parameters:
      s - GUID string, with optional dashes and braces
      microsoftStyleEncoding - true if the text uses Microsoft's mixed-endian field encoding
      Returns:
      a GUID object
    • random

      public static Guid random()
      Generate a random GUID.
      Returns:
      a random GUID object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Microsoft-style decoding.
      Overrides:
      toString in class Object
    • toString

      public String toString(boolean microsoftStyleDecoding, boolean useSeparators, boolean useBrackets)
      Format this GUID.
      Parameters:
      microsoftStyleDecoding - true to decode the first fields as little-endian values
      useSeparators - true to insert dash separators
      useBrackets - true to wrap the text in braces
      Returns:
      the formatted GUID