Enum Class Version
- All Implemented Interfaces:
Serializable
,Comparable<Version>
,Constable
Represents a version of the SSSOM specification.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Version
Parses an IRI into the corresponding SSSOM version object.static Version
fromString
(String v) Parses a string into the corresponding SSSOM version object.static Version
getHighestVersion
(Collection<Version> versions) Gets the most recent version of all the versions in the given collection.getIRI()
Gets the IRI associated to the enum value.boolean
isCompatibleWith
(Version target) Checks whether this version is compatible with the indicated version.toString()
static Version
Returns the enum constant of this class with the specified name.static Version[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SSSOM_1_0
SSSOM specification version 1.0. -
SSSOM_1_1
SSSOM specification version 1.1. -
UNKNOWN
Represents an unrecognised version of the specification (possibly, a version more recent than the latest supported by this implementation).
-
-
Field Details
-
LATEST
The latest version of the specification currently supported by this implementation.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
toString
-
getIRI
Gets the IRI associated to the enum value.- Returns:
- The IRI used to represent the enum value.
-
isCompatibleWith
Checks whether this version is compatible with the indicated version.For the purpose of this method, a version A is said to be compatible with another version B if an implementation compliant with B can accept data compliant with A. This is case iff: (1) both A and B have the same major version number, and (2) A’s minor version number is at most as high as B’s.
For example, version 1.0 is compatible with version 1.1; version 1.2 is not compatible with version 1.1.
- Parameters:
target
- The version to compare to.- Returns:
True
if this version is compatible with the target version,false
otherwise.
-
getHighestVersion
Gets the most recent version of all the versions in the given collection.- Parameters:
versions
- A collection of versions.- Returns:
- The most recent version, or
SSSOM_1_0
if the collection is empty.
-
fromString
Parses a string into the corresponding SSSOM version object.- Parameters:
v
- The string to parse.- Returns:
- The corresponding version, or
UNKNOWN
if the string does not match any recognised version.
-
fromIRI
Parses an IRI into the corresponding SSSOM version object.- Parameters:
iri
- The IRI to parse.- Returns:
- The corresponding version, or
UNKNOWN
if the IRI does not match any recognised version.
-