Package com.unboundid.ldap.sdk.persist
Class SetterInfo
- java.lang.Object
-
- com.unboundid.ldap.sdk.persist.SetterInfo
-
- All Implemented Interfaces:
java.io.Serializable
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class SetterInfo extends java.lang.Object implements java.io.Serializable
This class provides a data structure that holds information about an annotated setter method.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanfailOnInvalidValue()Indicates whether attempts to initialize an object should fail if the LDAP attribute has a value that cannot be represented in the argument type for the associated method.booleanfailOnTooManyValues()Indicates whether attempts to initialize an object should fail if the LDAP attribute has multiple values but the associated method argument can only hold a single value.java.lang.StringgetAttributeName()Retrieves the name of the LDAP attribute used to hold values for the associated method.java.lang.Class<?>getContainingClass()Retrieves the class that is marked with theLDAPObjectannotation and contains the associated field.ObjectEncodergetEncoder()Retrieves the encoder that should be used for the associated method.java.lang.reflect.MethodgetMethod()Retrieves the method with which this object is associated.booleansupportsMultipleValues()Indicates whether the associated method takes an argument that can hold multiple values.
-
-
-
Method Detail
-
getMethod
@NotNull public java.lang.reflect.Method getMethod()
Retrieves the method with which this object is associated.- Returns:
- The method with which this object is associated.
-
getContainingClass
@NotNull public java.lang.Class<?> getContainingClass()
Retrieves the class that is marked with theLDAPObjectannotation and contains the associated field.- Returns:
- The class that contains the associated field.
-
failOnInvalidValue
public boolean failOnInvalidValue()
Indicates whether attempts to initialize an object should fail if the LDAP attribute has a value that cannot be represented in the argument type for the associated method.- Returns:
trueif an exception should be thrown if an LDAP attribute has a value that cannot be provided as an argument to the associated method, orfalseif the method should not be invoked.
-
failOnTooManyValues
public boolean failOnTooManyValues()
Indicates whether attempts to initialize an object should fail if the LDAP attribute has multiple values but the associated method argument 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 method takes an argument that supports multiple values.- Returns:
trueif an exception should be thrown if an attribute has too many values to provide to the associated method, orfalseif the first value returned should be provided as an argument to the associated method.
-
getEncoder
@NotNull public ObjectEncoder getEncoder()
Retrieves the encoder that should be used for the associated method.- Returns:
- The encoder that should be used for the associated method.
-
getAttributeName
@NotNull public java.lang.String getAttributeName()
Retrieves the name of the LDAP attribute used to hold values for the associated method.- Returns:
- The name of the LDAP attribute used to hold values for the associated method.
-
supportsMultipleValues
public boolean supportsMultipleValues()
Indicates whether the associated method takes an argument that can hold multiple values.- Returns:
trueif the associated method takes an argument that can hold multiple values, orfalseif not.
-
-