Class LibraryDependency


  • public class LibraryDependency
    extends Object
    Describes a dependency on a library.
    • Constructor Detail

      • LibraryDependency

        public LibraryDependency​(String libraryName,
                                 String libraryVendor,
                                 String minimumLibraryVersion,
                                 String maximumLibraryVersion)
        Creates a new instance.
        Parameters:
        libraryName - the library name, cannot be null
        libraryVendor - the library vendor, cannot be null
        minimumLibraryVersion - the minumum (inclusive) supported library version, may be null
        maximumLibraryVersion - the maximum (inclusive) supported library version, may be null
      • LibraryDependency

        public LibraryDependency​(String libraryDependency)
        Creates a new instance from the specified string.

        The correct library dependecy format is "$LibraryName;$LibraryVendor;version=[$MinLibraryVersion,$MaxLibraryVersion]; "$LibraryName" and "$LibraryVendor" are required arguments, "$MinLibraryVersion", "$MaxLibraryVersion" are optional arguments.

        Parameters:
        libraryDependency - the string representation of the library dependecy, cannot be null
    • Method Detail

      • getLibraryName

        public String getLibraryName()
        Returns the library name.
        Returns:
        the library name, never null
      • getLibraryVendor

        public String getLibraryVendor()
        Returns the library vendor.
        Returns:
        the library vendor, never null
      • getMinimumLibraryVersion

        public String getMinimumLibraryVersion()
        Returns the minimum (inclusive) supported library version.
        Returns:
        the minimum supported library version, may be null
      • getMaximumLibraryVersion

        public String getMaximumLibraryVersion()
        Returns the maximum (inclusive) supported library version.
        Returns:
        the maximum supported library version, may be null
      • isVersionLessOrEqual

        public static boolean isVersionLessOrEqual​(String firstVersion,
                                                   String secondVersion)
        Checks if the first library version is less or equal the second library version.
        Parameters:
        firstVersion - the first library version, may be null
        secondVersion - the second library version, may be null
        Returns:
        true if the first version is less or equal the second version, false otherwise