Package com.dd.plist
Class UID
java.lang.Object
com.dd.plist.NSObject
com.dd.plist.UID
- All Implemented Interfaces:
Cloneable,Comparable<NSObject>
The UID class holds a unique identifier.
Only found in binary property lists that are keyed archives.
-
Field Summary
FieldsFields inherited from class com.dd.plist.NSObject
ASCII_LINE_LENGTH, NEWLINE -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new UID instance.UID(String name, BigInteger value) Creates a new UID instance. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a deep copy of this instance.intbooleanbyte[]getBytes()Gets this instance's value.getName()Gets this instance's name.inthashCode()protected voidtoASCII(StringBuilder ascii, int level) Generates the ASCII representation of this object.protected voidtoASCIIGnuStep(StringBuilder ascii, int level) Generates the ASCII representation of this object in the GnuStep format.(package private) voidGenerates the binary representation of the object.Converts this NSObject into an equivalent object of the Java Runtime Environment.toString()(package private) voidtoXML(StringBuilder xml, int level) The UID type has no dedicated representation in an XML property list.Methods inherited from class com.dd.plist.NSObject
assignIDs, fromJavaObject, indent, toJavaObject, toXMLPropertyList
-
Field Details
-
uid
-
name
-
-
Constructor Details
-
UID
Creates a new UID instance.- Parameters:
name- The UID name.value- The UID value.- Throws:
NullPointerException- If value is null.IllegalArgumentException- If value is negative or has a length of more than 128-bit.
-
UID
Creates a new UID instance.- Parameters:
name- The UID name.bytes- The UID value.- Throws:
NullPointerException- If bytes is null.IllegalArgumentException- If bytes represents a UID with a length of more than 128-bit (leading zero bytes are ignored).
-
-
Method Details
-
getBytes
public byte[] getBytes()Gets this instance's value.- Returns:
- The UID's value in big-endian representation, encoded on 1, 2, 4, 8 or 16 bytes.
-
getName
Gets this instance's name.- Returns:
- The UID's name.
-
clone
Description copied from class:NSObjectCreates and returns a deep copy of this instance. -
toJavaObject
Description copied from class:NSObjectConverts this NSObject into an equivalent object of the Java Runtime Environment.NSArrayobjects are converted to arrays.NSDictionaryobjects are converted to objects extending theMapclass.NSSetobjects are converted to objects extending theSetclass.NSNumberobjects are converted to primitive number values (int, long, double or boolean).NSStringobjects are converted toStringobjects.NSDataobjects are converted to byte arrays.NSDateobjects are converted toDateobjects.UIDobjects are converted to byte arrays.
- Specified by:
toJavaObjectin classNSObject- Returns:
- A native java object representing this NSObject's value.
-
toXML
The UID type has no dedicated representation in an XML property list. Typically, it is represented in XML as a dictionary with only one entry, where the key is "CF$UID" and the value is the integer representation of the UID. -
toBinary
Description copied from class:NSObjectGenerates the binary representation of the object.- Specified by:
toBinaryin classNSObject- Parameters:
out- The output stream to serialize the object to.- Throws:
IOException- If an I/O error occurs while writing to the stream or the object structure contains data that cannot be saved.
-
toASCII
Description copied from class:NSObjectGenerates the ASCII representation of this object. The generated ASCII representation does not end with a newline. Complies with the Old-Style ASCII Property Lists definition.- Specified by:
toASCIIin classNSObject- Parameters:
ascii- TheStringBuilderonto which the ASCII representation is appended.level- The indentation level of the object.
-
toASCIIGnuStep
Description copied from class:NSObjectGenerates the ASCII representation of this object in the GnuStep format. The generated ASCII representation does not end with a newline.- Specified by:
toASCIIGnuStepin classNSObject- Parameters:
ascii- TheStringBuilderonto which the ASCII representation is appended.level- The indentation level of the object.
-
compareTo
-
equals
-
hashCode
public int hashCode() -
toString
-