Record Class JsonDiff.Difference
java.lang.Object
java.lang.Record
cloud.opencode.base.json.diff.JsonDiff.Difference
- Enclosing class:
JsonDiff
public static record JsonDiff.Difference(JsonDiff.DiffType type, String path, JsonNode sourceValue, JsonNode targetValue)
extends Record
Represents a single difference between documents.
表示文档之间的单个差异。
- Since:
- JDK 25, opencode-base-json V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionDifference(JsonDiff.DiffType type, String path, JsonNode sourceValue, JsonNode targetValue) Creates an instance of aDifferencerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.path()Returns the value of thepathrecord component.Returns the value of thesourceValuerecord component.Returns the value of thetargetValuerecord component.toString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Difference
Creates an instance of aDifferencerecord class.- Parameters:
type- the value for thetyperecord componentpath- the value for thepathrecord componentsourceValue- the value for thesourceValuerecord componenttargetValue- the value for thetargetValuerecord component
-
-
Method Details
-
toString
-
hashCode
-
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). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-
sourceValue
Returns the value of thesourceValuerecord component.- Returns:
- the value of the
sourceValuerecord component
-
targetValue
Returns the value of thetargetValuerecord component.- Returns:
- the value of the
targetValuerecord component
-