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 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 a File record class.
      Parameters:
      id - the value for the id record component
      gameId - the value for the gameId record component
      modId - the value for the modId record component
      isAvailable - the value for the isAvailable record component
      displayName - the value for the displayName record component
      fileName - the value for the fileName record component
      releaseType - the value for the releaseType record component
      fileStatus - the value for the fileStatus record component
      hashes - the value for the hashes record component
      fileDate - the value for the fileDate record component
      fileLength - the value for the fileLength record component
      downloadCount - the value for the downloadCount record component
      downloadUrl - the value for the downloadUrl record component
      gameVersions - the value for the gameVersions record component
      sortableGameVersions - the value for the sortableGameVersions record component
      dependencies - the value for the dependencies record component
      exposeAsAlternative - the value for the exposeAsAlternative record component
      parentProjectFileId - the value for the parentProjectFileId record component
      alternateFileId - the value for the alternateFileId record component
      isServerPack - the value for the isServerPack record component
      serverPackFileId - the value for the serverPackFileId record component
      fileFingerprint - the value for the fileFingerprint record component
      modules - the value for the modules record component
  • Method Details

    • download

      public void download(Path path) throws IOException
      Attempts to download the file to the specified path, 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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public int id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • gameId

      public int gameId()
      Returns the value of the gameId record component.
      Returns:
      the value of the gameId record component
    • modId

      public int modId()
      Returns the value of the modId record component.
      Returns:
      the value of the modId record component
    • isAvailable

      public boolean isAvailable()
      Returns the value of the isAvailable record component.
      Returns:
      the value of the isAvailable record component
    • displayName

      public String displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component
    • fileName

      public String fileName()
      Returns the value of the fileName record component.
      Returns:
      the value of the fileName record component
    • releaseType

      public FileReleaseType releaseType()
      Returns the value of the releaseType record component.
      Returns:
      the value of the releaseType record component
    • fileStatus

      public FileStatus fileStatus()
      Returns the value of the fileStatus record component.
      Returns:
      the value of the fileStatus record component
    • hashes

      public List<FileHash> hashes()
      Returns the value of the hashes record component.
      Returns:
      the value of the hashes record component
    • fileDate

      public String fileDate()
      Returns the value of the fileDate record component.
      Returns:
      the value of the fileDate record component
    • fileLength

      public int fileLength()
      Returns the value of the fileLength record component.
      Returns:
      the value of the fileLength record component
    • downloadCount

      public int downloadCount()
      Returns the value of the downloadCount record component.
      Returns:
      the value of the downloadCount record component
    • downloadUrl

      public String downloadUrl()
      Returns the value of the downloadUrl record component.
      Returns:
      the value of the downloadUrl record component
    • gameVersions

      public List<String> gameVersions()
      Returns the value of the gameVersions record component.
      Returns:
      the value of the gameVersions record component
    • sortableGameVersions

      public List<SortableGameVersion> sortableGameVersions()
      Returns the value of the sortableGameVersions record component.
      Returns:
      the value of the sortableGameVersions record component
    • dependencies

      public List<FileDependency> dependencies()
      Returns the value of the dependencies record component.
      Returns:
      the value of the dependencies record component
    • exposeAsAlternative

      public Boolean exposeAsAlternative()
      Returns the value of the exposeAsAlternative record component.
      Returns:
      the value of the exposeAsAlternative record component
    • parentProjectFileId

      public Integer parentProjectFileId()
      Returns the value of the parentProjectFileId record component.
      Returns:
      the value of the parentProjectFileId record component
    • alternateFileId

      public Integer alternateFileId()
      Returns the value of the alternateFileId record component.
      Returns:
      the value of the alternateFileId record component
    • isServerPack

      public Boolean isServerPack()
      Returns the value of the isServerPack record component.
      Returns:
      the value of the isServerPack record component
    • serverPackFileId

      public Integer serverPackFileId()
      Returns the value of the serverPackFileId record component.
      Returns:
      the value of the serverPackFileId record component
    • fileFingerprint

      public int fileFingerprint()
      Returns the value of the fileFingerprint record component.
      Returns:
      the value of the fileFingerprint record component
    • modules

      public List<FileModule> modules()
      Returns the value of the modules record component.
      Returns:
      the value of the modules record component