Record Class ZipResult
java.lang.Object
java.lang.Record
cloud.opencode.base.io.compress.ZipResult
- Record Components:
zipFile- path to the ZIP file involved | 涉及的 ZIP 文件路径entryCount- number of entries processed | 处理的条目数originalSize- total uncompressed bytes | 原始未压缩总字节数compressedSize- total compressed bytes — forcompressthis is the size of the resulting ZIP on disk; forextractthis is the sum ofZipEntry.getCompressedSize()across processed entries. Note: when extract reads viaZipFilethe central-directory value is reliable, but entries lacking a compressedSize header field contribute0to the sum. | 压缩后总字节数 — compress 时为磁盘 ZIP 大小;extract 时为各条目ZipEntry.getCompressedSize()之和。当中央目录 字段缺失时该条目贡献0。compressionRatio-1.0 - compressed/original, in[0.0, 1.0]when sensible |1.0 - 压缩 / 原始,在合理时位于[0.0, 1.0]区间elapsed- wall-clock duration of the operation | 操作墙钟耗时entries- immutable list of entry names processed; passingnullis permitted and is normalised toList.of()in the canonical constructor. Nevernullon the accessor. | 处理的条目名(不可变列表);构造时允许传null,规范构造器会 归一化为List.of();访问器永不返回null
public record ZipResult(Path zipFile, int entryCount, long originalSize, long compressedSize, double compressionRatio, Duration elapsed, List<String> entries)
extends Record
Aggregated outcome of a ZIP
compress or extract operation.
ZIP 压缩或解压操作的汇总结果。
Captures sizing, timing and entry-name metadata so callers can record metrics or present compression-ratio summaries.
记录大小、耗时与条目名等元信息,便于调用方上报指标或展示压缩率摘要。
- Since:
- JDK 25, opencode-base-io V1.0.4
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thecompressedSizerecord component.doubleReturns the value of thecompressionRatiorecord component.elapsed()Returns the value of theelapsedrecord component.entries()Returns the value of theentriesrecord component.intReturns the value of theentryCountrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of theoriginalSizerecord component.final StringtoString()Returns a string representation of this record class.zipFile()Returns the value of thezipFilerecord component.
-
Constructor Details
-
ZipResult
-
-
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. -
zipFile
-
entryCount
public int entryCount()Returns the value of theentryCountrecord component.- Returns:
- the value of the
entryCountrecord component
-
originalSize
public long originalSize()Returns the value of theoriginalSizerecord component.- Returns:
- the value of the
originalSizerecord component
-
compressedSize
public long compressedSize()Returns the value of thecompressedSizerecord component.- Returns:
- the value of the
compressedSizerecord component
-
compressionRatio
public double compressionRatio()Returns the value of thecompressionRatiorecord component.- Returns:
- the value of the
compressionRatiorecord component
-
elapsed
-
entries
-