Package com.unboundid.ldap.sdk
Class ModificationType
java.lang.Object
com.unboundid.ldap.sdk.ModificationType
- All Implemented Interfaces:
Serializable
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class ModificationType
extends Object
implements Serializable
This class defines a data type for modification type values. Clients should
generally use one of the
ADD, DELETE, REPLACE, or
INCREMENT values, although it is possible to create a new
modification type with a specified integer value if necessary using the
valueOf(int) method. The following modification types are defined:
ADD-- Indicates that the provided value(s) should be added to the specified attribute in the target entry. If the attribute does not already exist, it will be created. If it does exist, then the new values will be merged added to the existing values. At least one value must be provided with theADDmodification type, and none of those values will be allowed to exist in the entry.DELETE-- Indicates that the specified attribute or attribute values should be removed from the entry. If no values are provided, then the entire attribute will be removed. If one or more values are given, then only those values will be removed. If any values are provided, then all of those values must exist in the target entry.REPLACE-- Indicates that the set of values for the specified attribute should be replaced with the provided value(s). If no values are given, then the specified attribute will be removed from the entry if it exists, or no change will be made. If one or more values are provided, then those values will replace the existing values if the attribute already exists, or a new attribute will be added with those values if there was previously no such attribute in the entry.INCREMENT-- Indicates that the value of the specified attribute should be incremented. The target entry must have exactly one value for the specified attribute and it must be an integer. The modification must include exactly one value, and it must be an integer which specifies the amount by which the existing value is to be incremented (or decremented, if the provided value is negative).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ModificationTypeA predefined add modification type, which indicates that the associated value(s) should be added to the specified attribute in the target entry.static final intThe integer value for the "add" modification type.static final ModificationTypeA predefined delete modification type, which indicates that the specified attribute or attribute values should be removed from the entry.static final intThe integer value for the "delete" modification type.static final ModificationTypeA predefined increment modification type, which indicates that the value of the specified attribute should be incremented.static final intThe integer value for the "increment" modification type.static final ModificationTypeA predefined replace modification type, which indicates that the set of values for the specified attribute should be replaced with the provided value(s).static final intThe integer value for the "replace" modification type. -
Method Summary
Modifier and TypeMethodDescriptionstatic ModificationTypedefinedValueOf(int intValue) Retrieves the predefined modification type with the specified integer value.booleanIndicates whether the provided object is equal to this modification type.getName()Retrieves the name for this modification type.inthashCode()The hash code for this modification type.intintValue()Retrieves the integer value for this modification type.toString()Retrieves a string representation of this modification type.static ModificationTypevalueOf(int intValue) Retrieves the modification type with the specified integer value.static ModificationType[]values()Retrieves an array of all modification types defined in the LDAP SDK.
-
Field Details
-
ADD_INT_VALUE
The integer value for the "add" modification type.- See Also:
-
ADD
A predefined add modification type, which indicates that the associated value(s) should be added to the specified attribute in the target entry. If the attribute does not already exist, it will be created. If it does exist, then the new values will be merged added to the existing values. At least one value must be provided with theADDmodification type, and none of those values will be allowed to exist in the entry. -
DELETE_INT_VALUE
The integer value for the "delete" modification type.- See Also:
-
DELETE
A predefined delete modification type, which indicates that the specified attribute or attribute values should be removed from the entry. If no values are provided, then the entire attribute will be removed. If one or more values are given, then only those values will be removed. If any values are provided, then all of those values must exist in the target entry. -
REPLACE_INT_VALUE
The integer value for the "replace" modification type.- See Also:
-
REPLACE
A predefined replace modification type, which indicates that the set of values for the specified attribute should be replaced with the provided value(s). If no values are given, then the specified attribute will be removed from the entry if it exists, or no change will be made. If one or more values are provided, then those values will replace the existing values if the attribute already exists, or a new attribute will be added with those values if there was previously no such attribute in the entry. -
INCREMENT_INT_VALUE
The integer value for the "increment" modification type.- See Also:
-
INCREMENT
A predefined increment modification type, which indicates that the value of the specified attribute should be incremented. The target entry must have exactly one value for the specified attribute and it must be an integer. The modification must include exactly one value, and it must be an integer which specifies the amount by which the existing value is to be incremented (or decremented, if the provided value is negative).
-
-
Method Details
-
getName
Retrieves the name for this modification type.- Returns:
- The name for this modification type.
-
intValue
Retrieves the integer value for this modification type.- Returns:
- The integer value for this modification type.
-
valueOf
Retrieves the modification type with the specified integer value.- Parameters:
intValue- The integer value for which to retrieve the corresponding modification type.- Returns:
- The modification type with the specified integer value, or a new modification type if the provided value does not match any of the predefined modification types.
-
definedValueOf
Retrieves the predefined modification type with the specified integer value.- Parameters:
intValue- The integer value for which to retrieve the corresponding modification type.- Returns:
- The modification type with the specified integer value, or
nullif the provided integer value does not represent a defined modification type.
-
values
Retrieves an array of all modification types defined in the LDAP SDK.- Returns:
- An array of all modification types defined in the LDAP SDK.
-
hashCode
The hash code for this modification type. -
equals
Indicates whether the provided object is equal to this modification type. -
toString
Retrieves a string representation of this modification type.
-