Package io.agentscope.core.agui.event
Record Class AguiEvent.JsonPatchOperation
java.lang.Object
java.lang.Record
io.agentscope.core.agui.event.AguiEvent.JsonPatchOperation
- Enclosing interface:
AguiEvent
public static record AguiEvent.JsonPatchOperation(String op, String path, Object value, String from)
extends Record
Represents a JSON Patch operation (RFC 6902). Used in
AguiEvent.StateDelta
events for
incremental state updates.-
Constructor Summary
ConstructorsConstructorDescriptionJsonPatchOperation(String op, String path, Object value, String from) Creates an instance of aJsonPatchOperationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic AguiEvent.JsonPatchOperationCreates an "add" operation.final booleanIndicates whether some other object is "equal to" this one.from()Returns the value of thefromrecord component.final inthashCode()Returns a hash code value for this object.op()Returns the value of theoprecord component.path()Returns the value of thepathrecord component.static AguiEvent.JsonPatchOperationCreates a "remove" operation.static AguiEvent.JsonPatchOperationCreates a "replace" operation.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
JsonPatchOperation
Creates an instance of aJsonPatchOperationrecord class.- Parameters:
op- the value for theoprecord componentpath- the value for thepathrecord componentvalue- the value for thevaluerecord componentfrom- the value for thefromrecord component
-
-
Method Details
-
add
Creates an "add" operation.- Parameters:
path- The path to add atvalue- The value to add- Returns:
- A new add operation
-
remove
Creates a "remove" operation.- Parameters:
path- The path to remove- Returns:
- A new remove operation
-
replace
Creates a "replace" operation.- Parameters:
path- The path to replacevalue- The new value- Returns:
- A new replace operation
-
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). -
op
Returns the value of theoprecord component.- Returns:
- the value of the
oprecord component
-
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
from
Returns the value of thefromrecord component.- Returns:
- the value of the
fromrecord component
-