Record Class SubVersionRange
java.lang.Object
java.lang.Record
com.viaversion.viaversion.api.protocol.version.SubVersionRange
-
Constructor Summary
ConstructorDescriptionSubVersionRange
(String baseVersion, int rangeFrom, int rangeTo) Creates a new version range. -
Method Summary
Modifier and TypeMethodDescriptionReturns the major version name.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the lowest included minor version.int
rangeTo()
Returns the highest included minor version.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
SubVersionRange
Creates a new version range. Giving "1.7", 0, and 5 for example would represent the range from 1.7-1.7.5.- Parameters:
baseVersion
- base versionrangeFrom
- minor version the range begins at, must be greater than or equal to 0rangeTo
- minor version the range ends at, must be greater thanrangeFrom
-
-
Method Details
-
baseVersion
Returns the major version name.- Returns:
- major version name
-
rangeFrom
public int rangeFrom()Returns the lowest included minor version.- Returns:
- lowest included minor version
-
rangeTo
public int rangeTo()Returns the highest included minor version.- Returns:
- highest included minor version
-
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. -
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. -
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with '=='.
-