Record Class Version
java.lang.Object
java.lang.Record
org.springframework.data.elasticsearch.support.Version
A version defined by 3 parts: major minor and revision number.
- Since:
- 4.3
- Author:
- Peter-Josef Meisch
- 
Constructor SummaryConstructorsConstructorDescriptionVersion(int major, int minor, int revision) Creates an instance of aVersionrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static VersionfromString(String s) Creates a version from a String that matchesPATTERN; major, minor and revision numbers separated by dots with optional trailing characters.final inthashCode()Returns a hash code value for this object.intmajor()Returns the value of themajorrecord component.intminor()Returns the value of theminorrecord component.intrevision()Returns the value of therevisionrecord component.toString()Returns a string representation of this record class.
- 
Constructor Details- 
Versionpublic Version(int major, int minor, int revision) Creates an instance of aVersionrecord class.- Parameters:
- major- the value for the- majorrecord component
- minor- the value for the- minorrecord component
- revision- the value for the- revisionrecord component
 
 
- 
- 
Method Details- 
toString
- 
fromStringCreates a version from a String that matchesPATTERN; major, minor and revision numbers separated by dots with optional trailing characters. A missing revision is treated as 0.- Parameters:
- s- the String to parse
- Returns:
- the Version
- Throws:
- IllegalArgumentException- if the input is null or cannot be parsed.
 
- 
hashCode
- 
equalsIndicates 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 thecomparemethod from their corresponding wrapper classes.
- 
majorpublic int major()Returns the value of themajorrecord component.- Returns:
- the value of the majorrecord component
 
- 
minorpublic int minor()Returns the value of theminorrecord component.- Returns:
- the value of the minorrecord component
 
- 
revisionpublic int revision()Returns the value of therevisionrecord component.- Returns:
- the value of the revisionrecord component
 
 
-