Package net.javasauce.ss.util
Record Class InMemoryDownload
java.lang.Object
java.lang.Record
net.javasauce.ss.util.InMemoryDownload
public record InMemoryDownload(boolean isUpToDate, byte[] body, @Nullable String etag)
extends Record
Created by covers1624 on 1/20/25.
-
Constructor Summary
ConstructorsConstructorDescriptionInMemoryDownload(boolean isUpToDate, byte[] body, @Nullable String etag) Creates an instance of aInMemoryDownloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]body()Returns the value of thebodyrecord component.static InMemoryDownloaddoDownload(net.covers1624.quack.net.httpapi.HttpEngine http, String url, @Nullable InMemoryDownload existing) final booleanIndicates whether some other object is "equal to" this one.@Nullable Stringetag()Returns the value of theetagrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisUpToDaterecord component.static @Nullable InMemoryDownloadtoString()Returns a string representation of this record class.void
-
Constructor Details
-
InMemoryDownload
Creates an instance of aInMemoryDownloadrecord class.- Parameters:
isUpToDate- the value for theisUpToDaterecord componentbody- the value for thebodyrecord componentetag- the value for theetagrecord component
-
-
Method Details
-
readFrom
- Throws:
IOException
-
writeTo
- Throws:
IOException
-
doDownload
public static InMemoryDownload doDownload(net.covers1624.quack.net.httpapi.HttpEngine http, String url, @Nullable @Nullable InMemoryDownload existing) -
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 '=='. -
isUpToDate
public boolean isUpToDate()Returns the value of theisUpToDaterecord component.- Returns:
- the value of the
isUpToDaterecord component
-
body
public byte[] body()Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-
etag
Returns the value of theetagrecord component.- Returns:
- the value of the
etagrecord component
-