Package com.unboundid.ldap.sdk.persist
Class FieldInfo
java.lang.Object
com.unboundid.ldap.sdk.persist.FieldInfo
- All Implemented Interfaces:
Serializable
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class FieldInfo
extends Object
implements Serializable
This class provides a data structure that holds information about an
annotated field.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether attempts to initialize an object should fail if the LDAP attribute has a value that cannot be stored in the associated field.booleanIndicates whether attempts to initialize an object should fail if the LDAP attribute has multiple values but the associated field can only hold a single value.Retrieves the name of the LDAP attribute used to hold values for the associated field.Class<?> Retrieves the class that is marked with theLDAPObjectannotation and contains the associated field.String[]Retrieves the set of default values that should be assigned to the associated field if there are no values for the corresponding attribute in the LDAP entry.String[]Retrieves the set of default values that should be used when creating an entry for an add operation if the associated field does not itself have any values.Retrieves the encoder that should be used for the associated field.getField()Retrieves the field with which this object is associated.Retrieves the filter usage for the associated field.String[]Retrieves the names of the object classes containing the associated attribute.booleanIndicates whether the associated field should be included in entries generated for add operations.booleanIndicates whether the associated field should be considered for inclusion in the set of modifications generated for modify operations.booleanIndicates whether the associated field should be used to generate entry RDNs.booleanIndicates whether the associated field should be considered required for decode operations.booleanIndicates whether the associated field should be considered required for encode operations.booleanIndicates whether the associated field should be lazily-loaded.booleanIndicates whether the associated field can hold multiple values.
-
Method Details
-
getField
Retrieves the field with which this object is associated.- Returns:
- The field with which this object is associated.
-
getContainingClass
Retrieves the class that is marked with theLDAPObjectannotation and contains the associated field.- Returns:
- The class that contains the associated field.
-
failOnInvalidValue
Indicates whether attempts to initialize an object should fail if the LDAP attribute has a value that cannot be stored in the associated field.- Returns:
trueif an exception should be thrown if an LDAP attribute has a value that cannot be assigned to the associated field, orfalseif the field should remain uninitialized.
-
failOnTooManyValues
Indicates whether attempts to initialize an object should fail if the LDAP attribute has multiple values but the associated field can only hold a single value. Note that the value returned from this method may befalseeven when the annotation has a value oftrueif the associated field supports multiple values.- Returns:
trueif an exception should be thrown if an attribute has too many values to hold in the associated field, orfalseif the first value returned should be assigned to the field.
-
includeInAdd
Indicates whether the associated field should be included in entries generated for add operations. Note that the value returned from this method may betrueeven when the annotation has a value offalseif the associated field is to be included in entry RDNs.- Returns:
trueif the associated field should be included in entries generated for add operations, orfalseif not.
-
includeInModify
Indicates whether the associated field should be considered for inclusion in the set of modifications generated for modify operations. Note that the value returned from this method may befalseeven when the annotation has a value oftruefor theinModifyelement if the associated field is to be included in entry RDNs.- Returns:
trueif the associated field should be considered for inclusion in the set of modifications generated for modify operations, orfalseif not.
-
includeInRDN
Indicates whether the associated field should be used to generate entry RDNs.- Returns:
trueif the associated field should be used to generate entry RDNs, orfalseif not.
-
getFilterUsage
Retrieves the filter usage for the associated field.- Returns:
- The filter usage for the associated field.
-
isRequiredForDecode
Indicates whether the associated field should be considered required for decode operations.- Returns:
trueif the associated field should be considered required for decode operations, orfalseif not.
-
isRequiredForEncode
Indicates whether the associated field should be considered required for encode operations. Note that the value returned from this method may betrueeven when the annotation has a value oftruefor therequiredForEncodeelement if the associated field is to be included in entry RDNs.- Returns:
trueif the associated field should be considered required for encode operations, orfalseif not.
-
lazilyLoad
Indicates whether the associated field should be lazily-loaded.- Returns:
trueif the associated field should be lazily-loaded, orfalseif not.
-
getEncoder
Retrieves the encoder that should be used for the associated field.- Returns:
- The encoder that should be used for the associated field.
-
getAttributeName
Retrieves the name of the LDAP attribute used to hold values for the associated field.- Returns:
- The name of the LDAP attribute used to hold values for the associated field.
-
getDefaultDecodeValues
Retrieves the set of default values that should be assigned to the associated field if there are no values for the corresponding attribute in the LDAP entry.- Returns:
- The set of default values for use when instantiating the object, or an empty array if no default values are defined.
-
getDefaultEncodeValues
Retrieves the set of default values that should be used when creating an entry for an add operation if the associated field does not itself have any values.- Returns:
- The set of default values for use in add operations, or an empty array if no default values are defined.
-
getObjectClasses
Retrieves the names of the object classes containing the associated attribute.- Returns:
- The names of the object classes containing the associated attribute.
-
supportsMultipleValues
Indicates whether the associated field can hold multiple values.- Returns:
trueif the associated field can hold multiple values, orfalseif not.
-