Package dev.latvian.mods.klib.io
Record Class FileMD5
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.io.FileMD5
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanchanged()Returns the value of thechangedrecord component.checksum()Returns the value of thechecksumrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thelastModifiedrecord component.static FileMD5load(FileInfo fileInfo, @Nullable LongConsumer progress) static @Nullable FileMD5loadChanged(FileInfo fileInfo, @Nullable LongConsumer progress) static @Nullable FileMD5loadExisting(FileInfo fileInfo) static FileMD5static voidlongsize()Returns the value of thesizerecord component.final StringtoString()Returns a string representation of this record class.voidwrite(ByteOutput data)
-
Field Details
-
CODEC
-
-
Constructor Details
-
FileMD5
Creates an instance of aFileMD5record class.- Parameters:
checksum- the value for thechecksumrecord componentsize- the value for thesizerecord componentlastModified- the value for thelastModifiedrecord componentchanged- the value for thechangedrecord component
-
-
Method Details
-
read
- Throws:
IOException
-
loadExisting
-
load
public static FileMD5 load(FileInfo fileInfo, @Nullable @Nullable LongConsumer progress) throws IOException - Throws:
IOException
-
save
- Throws:
IOException
-
loadChanged
@Nullable public static @Nullable FileMD5 loadChanged(FileInfo fileInfo, @Nullable @Nullable LongConsumer progress) throws IOException - Throws:
IOException
-
write
- Throws:
IOException
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
checksum
Returns the value of thechecksumrecord component.- Returns:
- the value of the
checksumrecord component
-
size
public long size()Returns the value of thesizerecord component.- Returns:
- the value of the
sizerecord component
-
lastModified
Returns the value of thelastModifiedrecord component.- Returns:
- the value of the
lastModifiedrecord component
-
changed
public boolean changed()Returns the value of thechangedrecord component.- Returns:
- the value of the
changedrecord component
-