Package 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
public static class Guid.GUID extends Structure
The Class GUID.- Author:
- Tobias Wolf, wolf.tobias@gmx.net
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGuid.GUID.ByReferenceThe Class ByReference.static classGuid.GUID.ByValue-
Nested classes/interfaces inherited from class com.sun.jna.Structure
Structure.StructField
-
-
Field Summary
Fields Modifier and Type Field Description intData1The Data1.shortData2The Data2.shortData3The Data3.byte[]Data4The Data4.static List<String>FIELDS-
Fields inherited from class com.sun.jna.Structure
ALIGN_DEFAULT, ALIGN_GNUC, ALIGN_MSVC, ALIGN_NONE, CALCULATE_SIZE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static Guid.GUIDfromBinary(byte[] data)From binary.static Guid.GUIDfromString(String guid)From string.protected List<String>getFieldOrder()Return this Structure's field names in their proper order.inthashCode()static Guid.GUIDnewGuid()Generates a new guid.byte[]toByteArray()To byte array.StringtoGuidString()The value of this Guid, formatted as follows: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.protected voidwriteFieldsToMemory()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, getFields, getNativeAlignment, getNativeSize, getNativeSize, getPointer, getStringEncoding, getStructAlignment, newInstance, newInstance, read, readField, readField, setAlignType, setAutoRead, setAutoSynch, setAutoWrite, setFieldOrder, setStringEncoding, size, sortFields, toArray, toArray, toString, toString, useMemory, useMemory, write, writeField, writeField, writeField
-
-
-
-
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(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(Object o)
-
hashCode
public int hashCode()
-
fromBinary
public static Guid.GUID fromBinary(byte[] data)
From binary.- Parameters:
data- the data- Returns:
- the guid
-
fromString
public static Guid.GUID fromString(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 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.
-
getFieldOrder
protected List<String> getFieldOrder()
Description copied from class:StructureReturn this Structure's field names in their proper order. For example,
IMPORTANT When deriving from an existing Structure subclass, ensure that you augment the list provided by the superclass, e.g.protected List getFieldOrder() { return Arrays.asList(new String[] { ... }); }
Field order must be explicitly indicated, since the field order as returned byprotected List getFieldOrder() { List fields = new ArrayList(super.getFieldOrder()); fields.addAll(Arrays.asList(new String[] { ... })); return fields; }Class.getFields()is not guaranteed to be predictable.- Overrides:
getFieldOrderin classStructure- Returns:
- ordered list of field names
-
-