Package com.isode.dsapi.syntax
Class DSEType
java.lang.Object
com.isode.dsapi.syntax.DSEType
DSE type. Allows converting to/from AttributeValue and
reading/modifying bits.
- Since:
- 15.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
clearFlag
(DSEType.Flag flag) Clear the given flag within the DSE type, and return the old value.boolean
Equality testConvert the DSEType into a 'dseType' AttributeValue.int
Get the dsetype represented as a packed integer (reverse-order 32-bit integer).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.boolean
hasFlag
(DSEType.Flag flag) Test whether this DSE type has the given flag set.int
hashCode()
Hash codeboolean
setFlag
(DSEType.Flag flag) 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.toString()
String representation for debugging (reverse packed bit-value).
-
Constructor Details
-
DSEType
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
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
Convert the DSEType into a 'dseType' AttributeValue.- Returns:
- AttributeValue
-
hasFlag
Test whether this DSE type has the given flag set.- Parameters:
flag
- Flag to test- Returns:
- State of flag
-
setFlag
Set or clear the given flag within the DSE type according to the argument, and return the old value.- Parameters:
flag
- Flag to set/clearvalue
- 'true' to set, 'false' to clear- Returns:
- Previous value
-
setFlag
Set the given flag within the DSE type, and return the old value.- Parameters:
flag
- Flag to set- Returns:
- Previous value
-
clearFlag
Clear the given flag within the DSE type, and return the old value.- Parameters:
flag
- Flag to clear- Returns:
- Previous value
-
equals
Equality test -
hashCode
public int hashCode()Hash code -
toString
String representation for debugging (reverse packed bit-value). -
getSearchFilter
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
-