Class PublisherVersion

  • All Implemented Interfaces:
    Comparable<PublisherVersion>

    public class PublisherVersion
    extends Object
    implements 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 Detail

      • of

        public static Optional<PublisherVersion> of​(Publisher publisher)
                                             throws IllegalArgumentException
        Parses the version of the given Publisher resource, if any. The version information is set in a jfs:version property, 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:version property, Optional.empty() if none
        Throws:
        IllegalArgumentException - if the version string contains characters that are not expected for a Publisher version.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object obj)
        Determines whether the given argument is a PublisherVersion instance holding the exact same version as this instance.
        Overrides:
        equals in class Object
        Returns:
        true if the obj is a PublisherVersion instance holding the exact same version as this instance.
      • isCompliantWith

        public boolean isCompliantWith​(PublisherVersion version)
        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:
        true if this version is equal to the given version or is higher.