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.
Author:
Daniel Dreibrodt
  • 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.
    • toASCII

      protected void toASCII(StringBuilder ascii, int level)
    • toASCIIGnuStep

      protected void toASCIIGnuStep(StringBuilder ascii, int level)
    • 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