public class PublisherVersion extends Object implements Comparable<PublisherVersion>
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.Modifier and Type | Method and Description |
---|---|
int |
compareTo(PublisherVersion o) |
boolean |
equals(Object obj)
Determines whether the given argument is a PublisherVersion instance holding the exact same version as this instance.
|
int |
hashCode() |
boolean |
isCompliantWith(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> |
of(org.eclipse.lyo.oslc4j.core.model.Publisher publisher)
Parses the version of the given Publisher resource, if any.
|
static PublisherVersion |
parse(String version)
Parses the given Publisher version.
|
String |
toString() |
public static Optional<PublisherVersion> of(org.eclipse.lyo.oslc4j.core.model.Publisher publisher) throws IllegalArgumentException
jfs:version
property, which may not be present for some Publishers.publisher
- the Publisher resource for which the version is to determine.jfs:version
property, Optional.empty()
if noneIllegalArgumentException
- if the version string contains characters that are not expected for a Publisher version.public static PublisherVersion parse(String version) throws IllegalArgumentException
version
- the Publisher version stringIllegalArgumentException
- if the version string contains characters that are not expected for a Publisher version.public boolean equals(Object obj)
public boolean isCompliantWith(PublisherVersion version)
version
- the reference version to testtrue
if this version is equal to the given version or is higher.public int compareTo(PublisherVersion o)
compareTo
in interface Comparable<PublisherVersion>