Package org.forgerock.opendj.ldap
Class Modification
java.lang.Object
org.forgerock.opendj.ldap.Modification
A modification to be performed on an entry during a Modify operation.
-
Constructor Summary
ConstructorDescriptionModification
(ModificationType modificationType, Attribute attribute) Creates a new modification having the provided modification type and attribute values to be updated. -
Method Summary
Modifier and TypeMethodDescriptionstatic Modification
Returns a new modification for adding an attribute with the provided description and values.static Modification
Returns a new DELETE modification.boolean
Returns the attribute containing the values to be modified.Returns the type of modification to be performed.int
hashCode()
static Modification
Returns a new modification for replacing all the values of the provided attribute with the provided values.toString()
withValues
(Object... values) Adds values to this modification's attribute.
-
Constructor Details
-
Modification
Creates a new modification having the provided modification type and attribute values to be updated. Note that while the returnedModification
is immutable, the underlying attribute may not be. The following code ensures that the returnedModification
is fully immutable:Modification change = new Modification(modificationType, Attributes .unmodifiableAttribute(attribute));
- Parameters:
modificationType
- The type of modification to be performed.attribute
- The the attribute containing the values to be modified.
-
-
Method Details
-
add
Returns a new modification for adding an attribute with the provided description and values.- Parameters:
attributeDescription
- The description of the attribute to be added.values
- The values of the attribute to be added.- Returns:
- a new ADD modification.
-
delete
Returns a new DELETE modification. If no values are provided, returns a modification for deleting the provided attribute. If one or more values are provided, returns a modification for deleting these values only.- Parameters:
attributeDescription
- The description of the attribute targeted by the modification.values
- An optional list of attribute values, if specified, the returned modification will be intended to delete these values only.- Returns:
- a new DELETE modification.
-
replace
Returns a new modification for replacing all the values of the provided attribute with the provided values. If the modification is applyied to an entry that does not contain the attribute, it is equivalent to an ADD modification.- Parameters:
attributeDescription
- The description of the attribute whose values should be replaced.values
- The new values for the attribute.- Returns:
- a new REPLACE modification.
-
withValues
Adds values to this modification's attribute.- Parameters:
values
- The values to be added to this modification's attribute.- Returns:
- this modification.
-
getAttribute
Returns the attribute containing the values to be modified.- Returns:
- The the attribute containing the values to be modified.
-
getModificationType
Returns the type of modification to be performed.- Returns:
- The type of modification to be performed.
-
toString
-
equals
-
hashCode
public int hashCode()
-