Record Class File
java.lang.Object
java.lang.Record
io.github.matyrobbrt.curseforgeapi.schemas.file.File
@CurseForgeSchema("https://docs.curseforge.com/#tocS_File")
public record File(int id, int gameId, int modId, boolean isAvailable, String displayName, String fileName, FileReleaseType releaseType, FileStatus fileStatus, List<FileHash> hashes, String fileDate, int fileLength, int downloadCount, String downloadUrl, List<String> gameVersions, List<SortableGameVersion> sortableGameVersions, List<FileDependency> dependencies, Boolean exposeAsAlternative, Integer parentProjectFileId, Integer alternateFileId, Boolean isServerPack, Integer serverPackFileId, int fileFingerprint, List<FileModule> modules)
extends Record
-
Constructor Summary
ConstructorDescriptionFile
(int id, int gameId, int modId, boolean isAvailable, String displayName, String fileName, FileReleaseType releaseType, FileStatus fileStatus, List<FileHash> hashes, String fileDate, int fileLength, int downloadCount, String downloadUrl, List<String> gameVersions, List<SortableGameVersion> sortableGameVersions, List<FileDependency> dependencies, Boolean exposeAsAlternative, Integer parentProjectFileId, Integer alternateFileId, Boolean isServerPack, Integer serverPackFileId, int fileFingerprint, List<FileModule> modules) Creates an instance of aFile
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealternateFileId
record component.Returns the value of thedependencies
record component.Returns the value of thedisplayName
record component.void
Attempts to download the file to the specifiedpath
, creating any directories to it, if they do not exist.int
Returns the value of thedownloadCount
record component.Returns the value of thedownloadUrl
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of theexposeAsAlternative
record component.fileDate()
Returns the value of thefileDate
record component.int
Returns the value of thefileFingerprint
record component.int
Returns the value of thefileLength
record component.fileName()
Returns the value of thefileName
record component.Returns the value of thefileStatus
record component.int
gameId()
Returns the value of thegameId
record component.Returns the value of thegameVersions
record component.final int
hashCode()
Returns a hash code value for this object.hashes()
Returns the value of thehashes
record component.int
id()
Returns the value of theid
record component.boolean
Returns the value of theisAvailable
record component.Returns the value of theisServerPack
record component.int
modId()
Returns the value of themodId
record component.modules()
Returns the value of themodules
record component.Returns the value of theparentProjectFileId
record component.Returns the value of thereleaseType
record component.Returns the value of theserverPackFileId
record component.Returns the value of thesortableGameVersions
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
File
public File(int id, int gameId, int modId, boolean isAvailable, String displayName, String fileName, FileReleaseType releaseType, FileStatus fileStatus, List<FileHash> hashes, String fileDate, int fileLength, int downloadCount, String downloadUrl, List<String> gameVersions, List<SortableGameVersion> sortableGameVersions, List<FileDependency> dependencies, Boolean exposeAsAlternative, Integer parentProjectFileId, Integer alternateFileId, Boolean isServerPack, Integer serverPackFileId, int fileFingerprint, List<FileModule> modules) Creates an instance of aFile
record class.- Parameters:
id
- the value for theid
record componentgameId
- the value for thegameId
record componentmodId
- the value for themodId
record componentisAvailable
- the value for theisAvailable
record componentdisplayName
- the value for thedisplayName
record componentfileName
- the value for thefileName
record componentreleaseType
- the value for thereleaseType
record componentfileStatus
- the value for thefileStatus
record componenthashes
- the value for thehashes
record componentfileDate
- the value for thefileDate
record componentfileLength
- the value for thefileLength
record componentdownloadCount
- the value for thedownloadCount
record componentdownloadUrl
- the value for thedownloadUrl
record componentgameVersions
- the value for thegameVersions
record componentsortableGameVersions
- the value for thesortableGameVersions
record componentdependencies
- the value for thedependencies
record componentexposeAsAlternative
- the value for theexposeAsAlternative
record componentparentProjectFileId
- the value for theparentProjectFileId
record componentalternateFileId
- the value for thealternateFileId
record componentisServerPack
- the value for theisServerPack
record componentserverPackFileId
- the value for theserverPackFileId
record componentfileFingerprint
- the value for thefileFingerprint
record componentmodules
- the value for themodules
record component
-
-
Method Details
-
download
Attempts to download the file to the specifiedpath
, creating any directories to it, if they do not exist.- Parameters:
path
- the path to save the file to- Throws:
IOException
- if an exception occurs while downloading
-
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 '=='. -
id
public int id()Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-
gameId
public int gameId()Returns the value of thegameId
record component.- Returns:
- the value of the
gameId
record component
-
modId
public int modId()Returns the value of themodId
record component.- Returns:
- the value of the
modId
record component
-
isAvailable
public boolean isAvailable()Returns the value of theisAvailable
record component.- Returns:
- the value of the
isAvailable
record component
-
displayName
Returns the value of thedisplayName
record component.- Returns:
- the value of the
displayName
record component
-
fileName
Returns the value of thefileName
record component.- Returns:
- the value of the
fileName
record component
-
releaseType
Returns the value of thereleaseType
record component.- Returns:
- the value of the
releaseType
record component
-
fileStatus
Returns the value of thefileStatus
record component.- Returns:
- the value of the
fileStatus
record component
-
hashes
Returns the value of thehashes
record component.- Returns:
- the value of the
hashes
record component
-
fileDate
Returns the value of thefileDate
record component.- Returns:
- the value of the
fileDate
record component
-
fileLength
public int fileLength()Returns the value of thefileLength
record component.- Returns:
- the value of the
fileLength
record component
-
downloadCount
public int downloadCount()Returns the value of thedownloadCount
record component.- Returns:
- the value of the
downloadCount
record component
-
downloadUrl
Returns the value of thedownloadUrl
record component.- Returns:
- the value of the
downloadUrl
record component
-
gameVersions
Returns the value of thegameVersions
record component.- Returns:
- the value of the
gameVersions
record component
-
sortableGameVersions
Returns the value of thesortableGameVersions
record component.- Returns:
- the value of the
sortableGameVersions
record component
-
dependencies
Returns the value of thedependencies
record component.- Returns:
- the value of the
dependencies
record component
-
exposeAsAlternative
Returns the value of theexposeAsAlternative
record component.- Returns:
- the value of the
exposeAsAlternative
record component
-
parentProjectFileId
Returns the value of theparentProjectFileId
record component.- Returns:
- the value of the
parentProjectFileId
record component
-
alternateFileId
Returns the value of thealternateFileId
record component.- Returns:
- the value of the
alternateFileId
record component
-
isServerPack
Returns the value of theisServerPack
record component.- Returns:
- the value of the
isServerPack
record component
-
serverPackFileId
Returns the value of theserverPackFileId
record component.- Returns:
- the value of the
serverPackFileId
record component
-
fileFingerprint
public int fileFingerprint()Returns the value of thefileFingerprint
record component.- Returns:
- the value of the
fileFingerprint
record component
-
modules
Returns the value of themodules
record component.- Returns:
- the value of the
modules
record component
-