Class DependencyUtil


  • public class DependencyUtil
    extends Object
    Dependency Utilities
    • Constructor Detail

      • DependencyUtil

        public DependencyUtil()
    • Method Detail

      • matches

        public static boolean matches​(@NotNull
                                      @NotNull Dependency[] deps,
                                      @NotNull
                                      @NotNull PackageId id)
        Checks if any of the dependencies matches the given id
        Parameters:
        deps - the list of dependencies
        id - the id
        Returns:
        true if matches
      • addExact

        public static Dependency[] addExact​(@NotNull
                                            @NotNull Dependency[] deps,
                                            @NotNull
                                            @NotNull PackageId id)
        Adds an exact dependency to the give package if it is not already contained in the given list.
        Parameters:
        deps - the original dependencies
        id - the id to add
        Returns:
        the new array of dependencies, or deps if nothing changed.
      • add

        public static Dependency[] add​(@NotNull
                                       @NotNull Dependency[] deps,
                                       @NotNull
                                       @NotNull Dependency dep)
        Adds an dependency to the give package if it is not already contained in the given list. version ranges are current ignored.
        Parameters:
        deps - the original dependencies
        dep - the dependency to add
        Returns:
        the new array of dependencies, or deps if nothing changed.