Package org.forgerock.opendj.ldap
Record Class Modification
java.lang.Object
java.lang.Record
org.forgerock.opendj.ldap.Modification
- Record Components:
modificationType
- The type of modification to be performed.attribute
- The attribute containing the values to be modified.
A modification to be performed on an entry during a Modify operation.
-
Constructor Summary
ConstructorsConstructorDescriptionModification
(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.Returns the value of theattribute
record component.static Modification
Returns a new DELETE modification.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of themodificationType
record component.static Modification
Returns a new modification for replacing all the values of the provided attribute with the provided values.toString()
Returns a string representation of this record class.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));
-
-
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.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
modificationType
Returns the value of themodificationType
record component.- Returns:
- the value of the
modificationType
record component
-
attribute
Returns the value of theattribute
record component.- Returns:
- the value of the
attribute
record component
-