Package com.dd.plist
Class UID
- java.lang.Object
-
- com.dd.plist.NSObject
-
- com.dd.plist.UID
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringnameprivate java.math.BigIntegeruid-
Fields inherited from class com.dd.plist.NSObject
ASCII_LINE_LENGTH, NEWLINE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UIDclone()Creates and returns a deep copy of this instance.intcompareTo(NSObject o)booleanequals(java.lang.Object o)byte[]getBytes()Gets this instance's value.java.lang.StringgetName()Gets this instance's name.inthashCode()protected voidtoASCII(java.lang.StringBuilder ascii, int level)Generates the ASCII representation of this object.protected voidtoASCIIGnuStep(java.lang.StringBuilder ascii, int level)Generates the ASCII representation of this object in the GnuStep format.(package private) voidtoBinary(BinaryPropertyListWriter out)Generates the binary representation of the object.java.lang.ObjecttoJavaObject()Converts this NSObject into an equivalent object of the Java Runtime Environment.java.lang.StringtoString()(package private) voidtoXML(java.lang.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
-
-
-
-
Constructor Detail
-
UID
public UID(java.lang.String name, java.math.BigInteger value)Creates a new UID instance.- Parameters:
name- The UID name.value- The UID value.- Throws:
java.lang.NullPointerException- If value is null.java.lang.IllegalArgumentException- If value is negative or has a length of more than 128-bit.
-
UID
public UID(java.lang.String name, byte[] bytes)Creates a new UID instance.- Parameters:
name- The UID name.bytes- The UID value.- Throws:
java.lang.NullPointerException- If bytes is null.java.lang.IllegalArgumentException- If bytes represents a UID with a length of more than 128-bit (leading zero bytes are ignored).
-
-
Method Detail
-
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
public java.lang.String getName()
Gets this instance's name.- Returns:
- The UID's name.
-
clone
public UID clone()
Description copied from class:NSObjectCreates and returns a deep copy of this instance.
-
toJavaObject
public java.lang.Object 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
void toXML(java.lang.StringBuilder xml, int level)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
void toBinary(BinaryPropertyListWriter out) throws java.io.IOException
Description copied from class:NSObjectGenerates the binary representation of the object.
-
toASCII
protected void toASCII(java.lang.StringBuilder ascii, int level)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.
-
toASCIIGnuStep
protected void toASCIIGnuStep(java.lang.StringBuilder ascii, int level)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
public int compareTo(NSObject o)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-