Package com.unboundid.ldap.sdk.persist
Enum FilterUsage
- java.lang.Object
-
- java.lang.Enum<FilterUsage>
-
- com.unboundid.ldap.sdk.persist.FilterUsage
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<FilterUsage>
public enum FilterUsage extends java.lang.Enum<FilterUsage>
This enumeration defines a set of options that indicate how the value of a field or getter method may be used in the process of constructing a search filter. The resulting filter will be constructed as a logical AND of equality components created from the structural object class and any auxiliary classes, as well as equality components created from the values of fields with theLDAPField
annotation type and/or the return values of methods with theLDAPGetter
annotation type.
If a class has any fields or getter methods with a filter usage ofREQUIRED
, then all fields and/or getter methods marked asREQUIRED
must have a non-null
value and will be included in the filter, and any other fields or getter methods marked asALWAYS_ALLOWED
orCONDITIONALLY_ALLOWED
with non-null
values will be included in the filter as well.
If a class does not have any fields or getter methods that are markedREQUIRED
, then at least one field or getter method markedALWAYS_ALLOWED
must have a non-null
value in order to generate a search filter from that object, and the resulting filter will contain components for all non-null
fields and/or getter methods markedALWAYS_ALLOWED
orCONDITIONALLY_ALLOWED
. If an object does not have any non-null
fields or getter methods markedREQUIRED
orALWAYS_ALLOWED
, then it will not be possible to generate a search filter from that object.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALWAYS_ALLOWED
Indicates that the associated field or getter method may always be included in a search filter if it has a value, regardless of whether any other fields or getter methods in the object may have values.CONDITIONALLY_ALLOWED
Indicates that the associated field or getter method may be included in a generated search filter if it has a non-null
value, and if at least one field or getter method markedREQUIRED
orALWAYS_ALLOWED
has a non-null
value.EXCLUDED
Indicates that the associated field or getter method will never be included in a search filter generated from an object, regardless of whether it has a value in that object.REQUIRED
Indicates that the associated field or getter method must have a value in an object in order to be able to generate a search filter from that object.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FilterUsage
forName(java.lang.String name)
Retrieves the filter usage with the specified name.static FilterUsage
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static FilterUsage[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
REQUIRED
public static final FilterUsage REQUIRED
Indicates that the associated field or getter method must have a value in an object in order to be able to generate a search filter from that object. If an attempt is made to generate a search filter from an object that does not have a value for the associated field or getter method, then an exception will be thrown.
-
ALWAYS_ALLOWED
public static final FilterUsage ALWAYS_ALLOWED
Indicates that the associated field or getter method may always be included in a search filter if it has a value, regardless of whether any other fields or getter methods in the object may have values. If the associated field or getter method does not have a value, then it will be excluded from the generated search filter. It is generally recommended that the corresponding attribute be indexed for equality in the directory server, or that the server otherwise be configured to perform fast equality searches for filters containing this attribute.
-
CONDITIONALLY_ALLOWED
public static final FilterUsage CONDITIONALLY_ALLOWED
Indicates that the associated field or getter method may be included in a generated search filter if it has a non-null
value, and if at least one field or getter method markedREQUIRED
orALWAYS_ALLOWED
has a non-null
value. This usage indicates that the associated field or getter method may be used to help refine a search filter, but is not sufficient to be included in a search filter by itself.
-
EXCLUDED
public static final FilterUsage EXCLUDED
Indicates that the associated field or getter method will never be included in a search filter generated from an object, regardless of whether it has a value in that object.
-
-
Method Detail
-
values
public static FilterUsage[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FilterUsage c : FilterUsage.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FilterUsage valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
forName
@Nullable public static FilterUsage forName(@NotNull java.lang.String name)
Retrieves the filter usage with the specified name.- Parameters:
name
- The name of the filter usage to retrieve. It must not benull
.- Returns:
- The requested filter usage, or
null
if no such usage is defined.
-
-