Record Class EditResult
java.lang.Object
java.lang.Record
io.agentscope.harness.agent.filesystem.model.EditResult
- Record Components:
path- absolute path of edited file,nullon failureerror- error message on failure,nullon successoccurrences- number of replacements made,nullon failure
Result of a file edit (string replacement) operation.
-
Constructor Summary
ConstructorsConstructorDescriptionEditResult(String path, String error, Integer occurrences) Creates an instance of aEditResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.static EditResultfinal inthashCode()Returns a hash code value for this object.booleanReturns the value of theoccurrencesrecord component.static EditResultpath()Returns the value of thepathrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EditResult
Creates an instance of aEditResultrecord class.- Parameters:
path- the value for thepathrecord componenterror- the value for theerrorrecord componentoccurrences- the value for theoccurrencesrecord component
-
-
Method Details
-
ok
-
fail
-
isSuccess
public boolean isSuccess() -
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). -
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-
occurrences
Returns the value of theoccurrencesrecord component.- Returns:
- the value of the
occurrencesrecord component
-