Record Class FileComparator.LineChange
java.lang.Object
java.lang.Record
cloud.opencode.base.io.file.FileComparator.LineChange
- Record Components:
lineNumber- the line number | 行号oldContent- the content in file1 | file1中的内容newContent- the content in file2 | file2中的内容
- Enclosing class:
FileComparator
public static record FileComparator.LineChange(int lineNumber, String oldContent, String newContent)
extends Record
A line change between two files.
两个文件之间的行变化。
- Since:
- JDK 25, opencode-base-io V1.2.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionLineChange(int lineNumber, String oldContent, String newContent) Creates an instance of aLineChangerecord 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.intReturns the value of thelineNumberrecord component.Returns the value of thenewContentrecord component.Returns the value of theoldContentrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LineChange
Creates an instance of aLineChangerecord class.- Parameters:
lineNumber- the value for thelineNumberrecord componentoldContent- the value for theoldContentrecord componentnewContent- the value for thenewContentrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
lineNumber
public int lineNumber()Returns the value of thelineNumberrecord component.- Returns:
- the value of the
lineNumberrecord component
-
oldContent
Returns the value of theoldContentrecord component.- Returns:
- the value of the
oldContentrecord component
-
newContent
Returns the value of thenewContentrecord component.- Returns:
- the value of the
newContentrecord component
-