Record Class BuildInfo

java.lang.Object
java.lang.Record
com.palmergames.bukkit.towny.object.BuildInfo
Record Components:
commit - The full SHA-1 hash of the most recent commit.
commitShort - The shortened hash of the most recent commit.
branch - The branch this jar was built from.
repositoryUrl - The url for the remote git repository.
message - The subject of the most recent commit.

@Internal public record BuildInfo(String commit, String commitShort, String branch, String repositoryUrl, String message) extends Record
Represents git build information for a Towny jar file.
  • Constructor Details

    • BuildInfo

      public BuildInfo(String commit, String commitShort, String branch, String repositoryUrl, String message)
      Creates an instance of a BuildInfo record class.
      Parameters:
      commit - the value for the commit record component
      commitShort - the value for the commitShort record component
      branch - the value for the branch record component
      repositoryUrl - the value for the repositoryUrl record component
      message - the value for the message record component
  • Method Details

    • retrieveBuildInfo

      public static BuildInfo retrieveBuildInfo(Towny plugin) throws IOException
      Throws:
      IOException
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • commit

      public String commit()
      Returns the value of the commit record component.
      Returns:
      the value of the commit record component
    • commitShort

      public String commitShort()
      Returns the value of the commitShort record component.
      Returns:
      the value of the commitShort record component
    • branch

      public String branch()
      Returns the value of the branch record component.
      Returns:
      the value of the branch record component
    • repositoryUrl

      public String repositoryUrl()
      Returns the value of the repositoryUrl record component.
      Returns:
      the value of the repositoryUrl record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component