Record Class GitVersion

java.lang.Object
java.lang.Record
io.jenkins.plugins.gitversionmonitor.GitVersion

@NullMarked public record GitVersion(Integer major, Integer minor, Integer patch, Integer build) extends Record
  • Constructor Details

    • GitVersion

      public GitVersion(Integer major, Integer minor, Integer patch, Integer build)
      Creates an instance of a GitVersion record class.
      Parameters:
      major - the value for the major record component
      minor - the value for the minor record component
      patch - the value for the patch record component
      build - the value for the build record component
  • Method Details

    • of

      public static GitVersion of(Integer major, Integer minor, Integer patch, Integer build)
    • parse

      public static @Nullable GitVersion parse(@Nullable String version)
      Parse a raw version string into a GitVersion object.
      Parameters:
      version - the version string from the "git --version" command
      Returns:
      a GitVersion object containing the parsed version information
    • toString

      public 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.
    • major

      public Integer major()
      Returns the value of the major record component.
      Returns:
      the value of the major record component
    • minor

      public Integer minor()
      Returns the value of the minor record component.
      Returns:
      the value of the minor record component
    • patch

      public Integer patch()
      Returns the value of the patch record component.
      Returns:
      the value of the patch record component
    • build

      public Integer build()
      Returns the value of the build record component.
      Returns:
      the value of the build record component