Class UID

All Implemented Interfaces:
Cloneable, 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 Details

  • Constructor Details

    • UID

      public UID(String name, BigInteger value)
      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

      public UID(String name, byte[] bytes)
      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

      public 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 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(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 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:
      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(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(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(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object