Package org.ehrbase.util
Record Class SemVer
java.lang.Object
java.lang.Record
org.ehrbase.util.SemVer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanbooleanbooleanbooleanmajor()Returns the value of themajorrecord component.minor()Returns the value of theminorrecord component.static SemVerpatch()Returns the value of thepatchrecord component.suffix()Returns the value of thesuffixrecord component.toString()Returns a string representation of this record class.
-
Field Details
-
SEMVER_REGEX
partial, release and pre-release versions are permitted -
NO_VERSION
-
-
Constructor Details
-
SemVer
Creates an instance of aSemVerrecord class.- Parameters:
major- the value for themajorrecord componentminor- the value for theminorrecord componentpatch- the value for thepatchrecord componentsuffix- the value for thesuffixrecord component
-
-
Method Details
-
parse
- Throws:
InvalidVersionFormatException
-
toVersionString
-
isNoVersion
public boolean isNoVersion() -
isPartial
public boolean isPartial() -
isRelease
public boolean isRelease() -
isPreRelease
public boolean isPreRelease() -
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. All components in this record class are compared withObjects::equals(Object,Object). -
major
Returns the value of themajorrecord component.- Returns:
- the value of the
majorrecord component
-
minor
Returns the value of theminorrecord component.- Returns:
- the value of the
minorrecord component
-
patch
Returns the value of thepatchrecord component.- Returns:
- the value of the
patchrecord component
-
suffix
Returns the value of thesuffixrecord component.- Returns:
- the value of the
suffixrecord component
-