Class OCList

java.lang.Object
com.isode.dsapi.util.OCList

public class OCList extends Object
Class for efficiently storing a list of objectclasses, providing various simple operations on them. Note that this is a compact representation suitable for use in hashes and indexes, etc.

See also ObjectClasses which is an expanded list of objectclasses suitable for analysis and manipulation. Note that this class can handle schema-unknown objectclasses, whereas ObjectClasses cannot.

Author:
jp
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct an empty OCList.
    Construct from an Attribute (or null, giving a blank list)
    Construct from an array of AttributeValue, as returned by EditedEntry.getCurrentValues() for example.
    Construct from an Entry.
    OCList(String[] arr)
    Construct from an array of strings.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Test to see if the objectclass list contains the given objectclass.
    boolean
    Compares according to equality of keys from generateKey().
    Generate a string key that will compare different only if the set of objectclasses should be regarded as different.
    Return the OCList as an array of Strings.
    Debug-string.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • OCList

      public OCList()
      Construct an empty OCList.
    • OCList

      public OCList(String[] arr)
      Construct from an array of strings.
    • OCList

      public OCList(AttributeValue[] avarr)
      Construct from an array of AttributeValue, as returned by EditedEntry.getCurrentValues() for example. Logs warnings if there are non-string objectclass attributes in the entry.
    • OCList

      public OCList(Entry ent)
      Construct from an Entry.
    • OCList

      public OCList(Attribute attr)
      Construct from an Attribute (or null, giving a blank list)
  • Method Details

    • generateKey

      public String generateKey()
      Generate a string key that will compare different only if the set of objectclasses should be regarded as different. It consists of the sorted list of lowercased objectclasses separated by spaces.
    • contains

      public boolean contains(String oc)
      Test to see if the objectclass list contains the given objectclass.
    • getStrings

      public String[] getStrings()
      Return the OCList as an array of Strings.
    • equals

      public boolean equals(Object o)
      Compares according to equality of keys from generateKey().
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Debug-string.
      Overrides:
      toString in class Object