Record Class MilestoneData

java.lang.Object
java.lang.Record
megamek.common.util.milestoneReleaseInformation.MilestoneData
Record Components:
label - Descriptive label for the milestone. Should correspond to the tail of the release's GitHub Url.
version - Version associated with the milestone.
useFallbackHyperlink - true if the url fetchers should all return their project releases page, instead of a page specific to that Milestone.

public record MilestoneData(String label, Version version, boolean useFallbackHyperlink) extends Record
Represents data about a milestone relating to MegaMek, MegaMekLab, or MekHQ releases.

Each MilestoneData instance contains a descriptive label, a Version object, and URLs pointing to the relevant release pages for each application. If any URL is null or blank, it is assigned a default value corresponding to each application's 'releases' page.

Since:
0.50.07
  • Constructor Details

    • MilestoneData

      public MilestoneData(String label, Version version, boolean useFallbackHyperlink)
      Creates an instance of a MilestoneData record class.
      Parameters:
      label - the value for the label record component
      version - the value for the version record component
      useFallbackHyperlink - the value for the useFallbackHyperlink record component
  • Method Details

    • getMegaMekUrl

      @Deprecated(since="0.51.0", forRemoval=true) public String getMegaMekUrl()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the full URL for the MegaMek release associated with this milestone.

      The URL is constructed using predefined URL segments and the MegaMek project name, along with the stored MegaMek URL.

      Returns:
      a complete URL string for the MegaMek release page.
      Since:
      0.50.07
    • getMegaMekLabUrl

      @Deprecated(since="0.51.0", forRemoval=true) public String getMegaMekLabUrl()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the full URL for the MegaMekLab release associated with this milestone.

      The URL is constructed dynamically using predefined URL segments, the MegaMekLab project name, and the label parameter.

      Returns:
      a complete URL string for the MegaMekLab release page.
      Since:
      0.50.07
    • getMekHQUrl

      public String getMekHQUrl()
      Returns the full URL for the MekHQ release associated with this milestone.

      The URL is dynamically constructed using predefined URL segments, the MekHQ project name, and the label parameter.

      Returns:
      a complete URL string for the MekHQ release page.
      Since:
      0.50.07
    • 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.
    • label

      public String label()
      Returns the value of the label record component.
      Returns:
      the value of the label record component
    • version

      public Version version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • useFallbackHyperlink

      public boolean useFallbackHyperlink()
      Returns the value of the useFallbackHyperlink record component.
      Returns:
      the value of the useFallbackHyperlink record component