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 aInputFileDTO
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.filename()
Returns the value of thefilename
record component.Returns the value of thefileSupplier
record component.static InputFileDTO
Creates an InputFileDTO from a URL.final int
hashCode()
Returns a hash code value for this object.boolean
Returns the value of thehasSpoiler
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
InputFileDTO
Creates an instance of aInputFileDTO
record class.- Parameters:
fileSupplier
- the value for thefileSupplier
record componentfilename
- the value for thefilename
record componenthasSpoiler
- the value for thehasSpoiler
record 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 thefileSupplier
record component.- Returns:
- the value of the
fileSupplier
record component
-
filename
Returns the value of thefilename
record component.- Returns:
- the value of the
filename
record component
-
hasSpoiler
public boolean hasSpoiler()Returns the value of thehasSpoiler
record component.- Returns:
- the value of the
hasSpoiler
record component
-