Record Class CsvChange
java.lang.Object
java.lang.Record
cloud.opencode.base.csv.diff.CsvChange
- Record Components:
type- the type of change | 变更类型rowIndex- the row index in the original (for REMOVED/MODIFIED) or target (for ADDED) | 原始中的行索引(REMOVED/MODIFIED)或目标中的行索引(ADDED)oldRow- the old row (null for ADDED) | 旧行(ADDED时为null)newRow- the new row (null for REMOVED) | 新行(REMOVED时为null)
public record CsvChange(CsvChange.ChangeType type, int rowIndex, CsvRow oldRow, CsvRow newRow)
extends Record
CSV Change - Represents a single change between two CSV documents
CSV变更 - 表示两个CSV文档之间的单个变更
An immutable record capturing a row-level difference. Used by CSV diff operations to report additions, removals, and modifications.
一个不可变记录,捕获行级差异。被CSV差异操作用于报告添加、删除和修改。
Usage Examples | 使用示例:
CsvChange added = new CsvChange(ChangeType.ADDED, 3, null, newRow);
CsvChange removed = new CsvChange(ChangeType.REMOVED, 1, oldRow, null);
CsvChange modified = new CsvChange(ChangeType.MODIFIED, 2, oldRow, newRow);
Security | 安全性:
- Thread-safe: Yes (immutable record) - 线程安全: 是(不可变记录)
- Since:
- JDK 25, opencode-base-csv V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe type of change between two CSV documents 两个CSV文档之间的变更类型 -
Constructor Summary
ConstructorsConstructorDescriptionCsvChange(CsvChange.ChangeType type, int rowIndex, CsvRow oldRow, CsvRow newRow) Creates an instance of aCsvChangerecord 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.newRow()Returns the value of thenewRowrecord component.oldRow()Returns the value of theoldRowrecord component.introwIndex()Returns the value of therowIndexrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
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. -
type
-
rowIndex
-
oldRow
-
newRow
-