Class DSEType

java.lang.Object
com.isode.dsapi.syntax.DSEType

public class DSEType extends Object
DSE type. Allows converting to/from AttributeValue and reading/modifying bits.
Since:
15.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Enum for DSEType flags.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct an empty DSEType.
    DSEType(int packed)
    Constructor from packed integer.
    Constructor from an AttributeValue.
    Copy constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Clear the given flag within the DSE type, and return the old value.
    boolean
    Equality test
    Convert the DSEType into a 'dseType' AttributeValue.
    int
    Get the dsetype represented as a packed integer (reverse-order 32-bit integer).
    static String
    Return a string suitable for use as a search filter which will match entries that have any of the specified DSEtype flags.
    boolean
    Test whether this DSE type has the given flag set.
    int
    Hash code
    boolean
    Set the given flag within the DSE type, and return the old value.
    boolean
    setFlag(DSEType.Flag flag, boolean value)
    Set or clear the given flag within the DSE type according to the argument, and return the old value.
    String representation for debugging (reverse packed bit-value).

    Methods inherited from class java.lang.Object

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

    • DSEType

      public DSEType(AttributeValue av) throws BadValueException
      Constructor from an AttributeValue.
      Parameters:
      av - AttributeValue
      Throws:
      BadValueException - if the BER extracted from the AttributeValue is invalid, which may happen over LDAP due to the LDAP string form not being in the Isode-recognised syntax
    • DSEType

      public DSEType(DSEType dt)
      Copy constructor.
      Parameters:
      dt - DSEType
    • DSEType

      public DSEType(int packed)
      Constructor from packed integer.
      Parameters:
      packed - Packed integer
    • DSEType

      public DSEType()
      Construct an empty DSEType.
  • Method Details

    • getPackedInt

      public int getPackedInt()
      Get the dsetype represented as a packed integer (reverse-order 32-bit integer).
      Returns:
      Packed integer
    • getAttributeValue

      public AttributeValue getAttributeValue()
      Convert the DSEType into a 'dseType' AttributeValue.
      Returns:
      AttributeValue
    • hasFlag

      public boolean hasFlag(DSEType.Flag flag)
      Test whether this DSE type has the given flag set.
      Parameters:
      flag - Flag to test
      Returns:
      State of flag
    • setFlag

      public boolean setFlag(DSEType.Flag flag, boolean value)
      Set or clear the given flag within the DSE type according to the argument, and return the old value.
      Parameters:
      flag - Flag to set/clear
      value - 'true' to set, 'false' to clear
      Returns:
      Previous value
    • setFlag

      public boolean setFlag(DSEType.Flag flag)
      Set the given flag within the DSE type, and return the old value.
      Parameters:
      flag - Flag to set
      Returns:
      Previous value
    • clearFlag

      public boolean clearFlag(DSEType.Flag flag)
      Clear the given flag within the DSE type, and return the old value.
      Parameters:
      flag - Flag to clear
      Returns:
      Previous value
    • equals

      public boolean equals(Object o)
      Equality test
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      String representation for debugging (reverse packed bit-value).
      Overrides:
      toString in class Object
      Returns:
      Debugging string
    • getSearchFilter

      public static String getSearchFilter(DSEType.Flag... flags)
      Return a string suitable for use as a search filter which will match entries that have any of the specified DSEtype flags. For example:
          String s = DSEType.getSearchFilter(Flag.CP, Flag.SUBR);
       
      will return the String "(dseType='001001'B)"
      Parameters:
      flags - an array of Flags. If this is null, or empty, then the String returned by this method will be empty (""). It is safe to specify the same Flag more than once (the extra values will have no effect).
      Returns:
      a String suitable for using as a search filter, or part of a search filter.
      Since:
      15.0