Package net.morimekta.diff
Class Change
- java.lang.Object
-
- net.morimekta.diff.Change
-
public class Change extends java.lang.Object
Class representing one diff operation.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Is this DiffBase equivalent to another DiffBase?int
hashCode()
Create a numeric hash value for a DiffBase.java.lang.String
patchLine()
java.lang.String
toString()
Display a human-readable version of this DiffBase.
-
-
-
Field Detail
-
operation
public Operation operation
One of: INSERT, DELETE or EQUAL.
-
text
public java.lang.String text
The text associated with this diff operation.
-
-
Constructor Detail
-
Change
public Change(Operation operation, java.lang.String text)
Constructor. Initializes the diff with the provided values.- Parameters:
operation
- One of INSERT, DELETE or EQUAL.text
- The text being applied.
-
-
Method Detail
-
toString
public java.lang.String toString()
Display a human-readable version of this DiffBase.- Overrides:
toString
in classjava.lang.Object
- Returns:
- text version.
-
hashCode
public int hashCode()
Create a numeric hash value for a DiffBase. This function is not used by DMP.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- Hash value.
-
equals
public boolean equals(java.lang.Object o)
Is this DiffBase equivalent to another DiffBase?- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- Another Change to compare against.- Returns:
- true or false.
-
patchLine
public java.lang.String patchLine()
-
-