Record Class FileComparator.DirectoryDiff
java.lang.Object
java.lang.Record
cloud.opencode.base.io.file.FileComparator.DirectoryDiff
- Record Components:
onlyInFirst- paths only in first directory | 仅在第一个目录中的路径onlyInSecond- paths only in second directory | 仅在第二个目录中的路径common- paths in both directories | 两个目录中都有的路径different- common paths with different content | 内容不同的共同路径
- Enclosing class:
FileComparator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncommon()Returns the value of thecommonrecord component.intReturns the total number of differences.Returns the value of thedifferentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns true if directories are identical.Returns the value of theonlyInFirstrecord component.Returns the value of theonlyInSecondrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DirectoryDiff
public DirectoryDiff(Set<Path> onlyInFirst, Set<Path> onlyInSecond, Set<Path> common, Set<Path> different) Creates an instance of aDirectoryDiffrecord class.- Parameters:
onlyInFirst- the value for theonlyInFirstrecord componentonlyInSecond- the value for theonlyInSecondrecord componentcommon- the value for thecommonrecord componentdifferent- the value for thedifferentrecord component
-
-
Method Details
-
isIdentical
public boolean isIdentical()Returns true if directories are identical. 如果目录相同返回true。- Returns:
- true if identical | 如果相同返回true
-
differenceCount
public int differenceCount()Returns the total number of differences. 返回差异总数。- Returns:
- difference count | 差异数量
-
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). -
onlyInFirst
Returns the value of theonlyInFirstrecord component.- Returns:
- the value of the
onlyInFirstrecord component
-
onlyInSecond
Returns the value of theonlyInSecondrecord component.- Returns:
- the value of the
onlyInSecondrecord component
-
common
-
different
-