Record Class InputFileDTO
java.lang.Object
java.lang.Record
io.github.yvasyliev.telegramforwarderbot.dto.InputFileDTO
- Record Components:
fileSupplier- a supplier for the input stream of the filefilename- the name of the filehasSpoiler- indicates if the file has a spoiler
public record InputFileDTO(InputStreamSupplier fileSupplier, String filename, boolean hasSpoiler)
extends Record
Data Transfer Object for input files.
-
Constructor Summary
ConstructorsConstructorDescriptionInputFileDTO(InputStreamSupplier fileSupplier, String filename, boolean hasSpoiler) Creates an instance of aInputFileDTOrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.filename()Returns the value of thefilenamerecord component.Returns the value of thefileSupplierrecord component.static InputFileDTOCreates an InputFileDTO from a URL.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehasSpoilerrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
InputFileDTO
Creates an instance of aInputFileDTOrecord class.- Parameters:
fileSupplier- the value for thefileSupplierrecord componentfilename- the value for thefilenamerecord componenthasSpoiler- the value for thehasSpoilerrecord component
-
-
Method Details
-
fromUrl
Creates an InputFileDTO from a URL.- Parameters:
url- the URL of the filehasSpoiler- indicates if the file has a spoiler- Returns:
- a new InputFileDTO instance
-
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 '=='. -
fileSupplier
Returns the value of thefileSupplierrecord component.- Returns:
- the value of the
fileSupplierrecord component
-
filename
Returns the value of thefilenamerecord component.- Returns:
- the value of the
filenamerecord component
-
hasSpoiler
public boolean hasSpoiler()Returns the value of thehasSpoilerrecord component.- Returns:
- the value of the
hasSpoilerrecord component
-