Record Class ModifyRequest
java.lang.Object
java.lang.Record
org.forgerock.opendj.ldap.messages.ModifyRequest
- Record Components:
name
- the distinguished name of the entry to be modified. The server shall not perform any alias dereferencing in determining the object to be modified.modifications
- theList
containing the modifications included with this modify request. The returnedList
may be modified if permitted by this modify request.controls
- theList
containing the controls.
- All Implemented Interfaces:
ProtocolOp
,Request
,ChangeRecord
public record ModifyRequest(Dn name, List<Modification> modifications, List<Control> controls)
extends Record
implements ChangeRecord
The Modify operation allows a client to request that a modification of an
entry be performed on its behalf by a server.
The following example adds a member to a static group entry.
Connection connection = ...; String groupDN = ...; String memberDN = ...; ModifyRequest addMember = Requests.newModifyRequest(groupDN) .addModification(ModificationType.ADD, "member", memberDN); connection.modify(addMember);
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.forgerock.opendj.ldap.messages.Request
Request.RequestType
-
Constructor Summary
ConstructorsConstructorDescriptionModifyRequest
(Dn name, List<Modification> modifications, List<Control> controls) Create newModifyRequest
with the entry to be added and theList
containing the controls. -
Method Summary
Modifier and TypeMethodDescription<R,
P, E extends Exception>
Raccept
(RequestVisitor<R, P, E> v, P p) Applies aRequestVisitor
to thisRequest
.controls()
Returns the value of thecontrols
record component.final boolean
Indicates whether some other object is "equal to" this one.getType()
Returns the type of this request to avoid expensiveinstanceof
checks.final int
hashCode()
Returns a hash code value for this object.Returns the value of themodifications
record component.name()
Returns the value of thename
record component.final String
toString()
Returns a string representation of this record class.with
(Modification modification) Adds the provided modification to this modify request.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.forgerock.opendj.ldap.messages.ProtocolOp
addControl, addControls, containsControl, getControl, getControl, removeControls
-
Constructor Details
-
ModifyRequest
Create newModifyRequest
with the entry to be added and theList
containing the controls.
-
-
Method Details
-
accept
Description copied from interface:Request
Applies aRequestVisitor
to thisRequest
.- Specified by:
accept
in interfaceRequest
- Type Parameters:
R
- The return type of the visitor's methods.P
- The type of the additional parameters to the visitor's methods.E
- The type of the exception thrown by the visitor method if it fails, orNeverThrowsException
if the visitor cannot fail.- Parameters:
v
- The request visitor.p
- Optional additional visitor parameter.- Returns:
- A result as specified by the visitor.
- Throws:
E
- If the visitor failed.
-
getType
Description copied from interface:Request
Returns the type of this request to avoid expensiveinstanceof
checks. -
with
Adds the provided modification to this modify request.- Parameters:
modification
- The modification.- Returns:
- This modify request.
- Throws:
UnsupportedOperationException
- If the this request is immutable.
-
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)
. -
name
Returns the value of thename
record component.- Specified by:
name
in interfaceChangeRecord
- Returns:
- the value of the
name
record component
-
modifications
Returns the value of themodifications
record component.- Returns:
- the value of the
modifications
record component
-
controls
Returns the value of thecontrols
record component.- Specified by:
controls
in interfaceProtocolOp
- Returns:
- the value of the
controls
record component
-