com.sun.jna.platform.win32

## Class Guid.GUID

- java.lang.Object
- - com.sun.jna.Structure
  - - com.sun.jna.platform.win32.Guid.GUID

Direct Known Subclasses:
  Guid.CLSID, Guid.CLSID.ByReference, Guid.GUID.ByReference, Guid.GUID.ByValue, Guid.IID

Enclosing interface:
  Guid

    @Structure.FieldOrder(value={"Data1","Data2","Data3","Data4"})
    public static class Guid.GUID
    extends Structure

The Class GUID.

Author:
  Tobias Wolf, wolf.tobias@gmx.net

### Nested Class Summary

Nested Classes
`static class` `Guid.GUID.ByReference` The Class ByReference.
`static class` `Guid.GUID.ByValue`

### Nested classes/interfaces inherited from class com.sun.jna.Structure

`Structure.FieldOrder, Structure.StructField`

### Field Summary

Fields
`int` `Data1` The Data1.
`short` `Data2` The Data2.
`short` `Data3` The Data3.
`byte[]` `Data4` The Data4.

### Fields inherited from class com.sun.jna.Structure

`ALIGN_DEFAULT, ALIGN_GNUC, ALIGN_MSVC, ALIGN_NONE, CALCULATE_SIZE`

### Constructor Summary

Constructors
Constructor and Description
`GUID()` Instantiates a new guid.
`GUID(byte[] data)` Instantiates a new guid.
`GUID(Guid.GUID guid)` Instantiates a new guid.
`GUID(Pointer memory)` Instantiates a new guid.
`GUID(java.lang.String guid)` Instantiates a new guid.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `equals(java.lang.Object o)`
`static Guid.GUID` `fromBinary(byte[] data)` From binary.
`static Guid.GUID` `fromString(java.lang.String guid)` From string.
`int` `hashCode()`
`static Guid.GUID` `newGuid()` Generates a new guid.
`byte[]` `toByteArray()` To byte array.
`java.lang.String` `toGuidString()` The value of this Guid, formatted as follows: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
`protected void` `writeFieldsToMemory()` Write fields to backing memory.

### Methods inherited from class com.sun.jna.Structure

`allocateMemory, allocateMemory, autoAllocate, autoRead, autoRead, autoWrite, autoWrite, cacheTypeInfo, calculateSize, clear, createFieldsOrder, createFieldsOrder, createFieldsOrder, createFieldsOrder, dataEquals, dataEquals, ensureAllocated, fieldOffset, getAutoRead, getAutoWrite, getFieldList, getFieldOrder, getFields, getNativeAlignment, getNativeSize, getNativeSize, getPointer, getStringEncoding, getStructAlignment, newInstance, newInstance, read, readField, readField, setAlignType, setAutoRead, setAutoSynch, setAutoWrite, setStringEncoding, size, sortFields, toArray, toArray, toString, toString, useMemory, useMemory, write, writeField, writeField, writeField`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Field Detail

#### Data1

    public int Data1

The Data1.

#### Data2

    public short Data2

The Data2.

#### Data3

    public short Data3

The Data3.

#### Data4

    public byte[] Data4

The Data4.

### Constructor Detail

#### GUID

    public GUID()

Instantiates a new guid.

#### GUID

    public GUID(Guid.GUID guid)

Instantiates a new guid.

Parameters:
  `guid` - the guid

#### GUID

    public GUID(java.lang.String guid)

Instantiates a new guid.

Parameters:
  `guid` - the guid

#### GUID

    public GUID(byte[] data)

Instantiates a new guid.

Parameters:
  `data` - the data

#### GUID

    public GUID(Pointer memory)

Instantiates a new guid.

Parameters:
  `memory` - the memory

### Method Detail

#### equals

    public boolean equals(java.lang.Object o)

Overrides:
  `equals` in class `Structure`
Returns:
  whether the given structure's type and pointer match.

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Structure`
Returns:
  hash code for this structure's pointer.

#### fromBinary

    public static Guid.GUID fromBinary(byte[] data)

From binary.

Parameters:
  `data` - the data
Returns:
  the guid

#### fromString

    public static Guid.GUID fromString(java.lang.String guid)

From string.

Parameters:
  `guid` - the guid
Returns:
  the guid

#### newGuid

    public static Guid.GUID newGuid()

Generates a new guid. Code taken from the standard jdk implementation (see UUID class).

Returns:
  the guid

#### toByteArray

    public byte[] toByteArray()

To byte array.

Returns:
  the byte[]

#### toGuidString

    public java.lang.String toGuidString()

The value of this Guid, formatted as follows: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.

Returns:
  the string

#### writeFieldsToMemory

    protected void writeFieldsToMemory()

Write fields to backing memory.

Copyright © 2007-2018 Timothy Wall. All Rights Reserved.