Package com.sodius.oslc.app.jazz.model
Class PublisherVersion
java.lang.Object
com.sodius.oslc.app.jazz.model.PublisherVersion
- All Implemented Interfaces:
Comparable<PublisherVersion>
Represents the version of a Publisher resource, usually set using a
jfs:version property.
Enables comparing two version instances, to determine if the version of the actual friend application
is compatible with an expected reference version.- Since:
- 1.13.0
-
Method Summary
Modifier and TypeMethodDescriptionintbooleanDetermines whether the given argument is a PublisherVersion instance holding the exact same version as this instance.inthashCode()booleanisCompliantWith(PublisherVersion version) Determines whether this instance is compatible with the given version, meaning it is either the same version or is higher.static Optional<PublisherVersion> Parses the version of the given Publisher resource, if any.static PublisherVersionParses the given Publisher version.toString()
-
Method Details
-
of
Parses the version of the given Publisher resource, if any. The version information is set in ajfs:versionproperty, which may not be present for some Publishers.- Parameters:
publisher- the Publisher resource for which the version is to determine.- Returns:
- an Optional holding the parsed
jfs:versionproperty,Optional.empty()if none - Throws:
IllegalArgumentException- if the version string contains characters that are not expected for a Publisher version.
-
parse
Parses the given Publisher version.- Parameters:
version- the Publisher version string- Returns:
- a PublisherVersion instance.
- Throws:
IllegalArgumentException- if the version string contains characters that are not expected for a Publisher version.
-
hashCode
public int hashCode() -
equals
Determines whether the given argument is a PublisherVersion instance holding the exact same version as this instance. -
isCompliantWith
Determines whether this instance is compatible with the given version, meaning it is either the same version or is higher. This method is suitable to determine if the version of the actual friend application is compatible with an expected reference version.- Parameters:
version- the reference version to test- Returns:
trueif this version is equal to the given version or is higher.
-
compareTo
- Specified by:
compareToin interfaceComparable<PublisherVersion>
-
toString
-