Record Class Version.Range

java.lang.Object
java.lang.Record
com.elo.gradle.osgi.utils.Version.Range
Enclosing class:
Version

public static record Version.Range(String lowerBound, Version minVersion, Version maxVersion, String upperBound) extends Record
Class representing an OSGi version range.
  • Field Details

  • Constructor Details

    • Range

      public Range(String lowerBound, Version minVersion, Version maxVersion, String upperBound)
      Creates an instance of a Range record class.
      Parameters:
      lowerBound - the value for the lowerBound record component
      minVersion - the value for the minVersion record component
      maxVersion - the value for the maxVersion record component
      upperBound - the value for the upperBound record component
  • Method Details

    • isLowerBoundInclusive

      public boolean isLowerBoundInclusive()
      Returns whether the min version is inclusive.
      Returns:
      true if the min version is inclusive, false otherwise
    • isUpperBoundInclusive

      public boolean isUpperBoundInclusive()
      Returns whether the max version is inclusive.
      Returns:
      true if the max version is inclusive, false otherwise
    • isVersionRange

      public static boolean isVersionRange(String s)
      Checks if a string is a valid version range.
      Parameters:
      s - the string to check
      Returns:
      true if the string is a valid version range, false otherwise
    • valueOf

      public static Version.Range valueOf(String s)
      Parses a version range string into a Range object.
      Parameters:
      s - the version range string
      Returns:
      the Range object
    • 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.
    • lowerBound

      public String lowerBound()
      Returns the value of the lowerBound record component.
      Returns:
      the value of the lowerBound record component
    • minVersion

      public Version minVersion()
      Returns the value of the minVersion record component.
      Returns:
      the value of the minVersion record component
    • maxVersion

      public Version maxVersion()
      Returns the value of the maxVersion record component.
      Returns:
      the value of the maxVersion record component
    • upperBound

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