Package com.dd.plist

Class UID

  • All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Comparable<NSObject>

    public class UID
    extends NSObject
    The UID class holds a unique identifier. Only found in binary property lists that are keyed archives.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String name  
      private java.math.BigInteger uid  
    • Constructor Summary

      Constructors 
      Constructor Description
      UID​(java.lang.String name, byte[] bytes)
      Creates a new UID instance.
      UID​(java.lang.String name, java.math.BigInteger value)
      Creates a new UID instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      UID clone()
      Creates and returns a deep copy of this instance.
      int compareTo​(NSObject o)  
      boolean equals​(java.lang.Object o)  
      byte[] getBytes()
      Gets this instance's value.
      java.lang.String getName()
      Gets this instance's name.
      int hashCode()  
      protected void toASCII​(java.lang.StringBuilder ascii, int level)
      Generates the ASCII representation of this object.
      protected void toASCIIGnuStep​(java.lang.StringBuilder ascii, int level)
      Generates the ASCII representation of this object in the GnuStep format.
      (package private) void toBinary​(BinaryPropertyListWriter out)
      Generates the binary representation of the object.
      java.lang.Object toJavaObject()
      Converts this NSObject into an equivalent object of the Java Runtime Environment.
      java.lang.String toString()  
      (package private) void toXML​(java.lang.StringBuilder xml, int level)
      The UID type has no dedicated representation in an XML property list.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • uid

        private final java.math.BigInteger uid
      • name

        private final java.lang.String name
    • 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: NSObject
        Creates and returns a deep copy of this instance.
        Specified by:
        clone in class NSObject
        Returns:
        A clone of this instance.
      • toJavaObject

        public java.lang.Object toJavaObject()
        Description copied from class: NSObject
        Converts this NSObject into an equivalent object of the Java Runtime Environment.
        • NSArray objects are converted to arrays.
        • NSDictionary objects are converted to objects extending the Map class.
        • NSSet objects are converted to objects extending the Set class.
        • NSNumber objects are converted to primitive number values (int, long, double or boolean).
        • NSString objects are converted to String objects.
        • NSData objects are converted to byte arrays.
        • NSDate objects are converted to Date objects.
        • UID objects are converted to byte arrays.
        Specified by:
        toJavaObject in class NSObject
        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.
        Specified by:
        toXML in class NSObject
        Parameters:
        xml - The XML StringBuilder
        level - The indentation level
      • toBinary

        void toBinary​(BinaryPropertyListWriter out)
               throws java.io.IOException
        Description copied from class: NSObject
        Generates the binary representation of the object.
        Specified by:
        toBinary in class NSObject
        Parameters:
        out - The output stream to serialize the object to.
        Throws:
        java.io.IOException - If an I/O error occurs while writing to the stream or the object structure contains data that cannot be saved.
      • toASCII

        protected void toASCII​(java.lang.StringBuilder ascii,
                               int level)
        Description copied from class: NSObject
        Generates 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:
        toASCII in class NSObject
        Parameters:
        ascii - The StringBuilder onto which the ASCII representation is appended.
        level - The indentation level of the object.
      • toASCIIGnuStep

        protected void toASCIIGnuStep​(java.lang.StringBuilder ascii,
                                      int level)
        Description copied from class: NSObject
        Generates the ASCII representation of this object in the GnuStep format. The generated ASCII representation does not end with a newline.
        Specified by:
        toASCIIGnuStep in class NSObject
        Parameters:
        ascii - The StringBuilder onto 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:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object