public class DependencyUtil
extends java.lang.Object
Constructor and Description |
---|
DependencyUtil() |
Modifier and Type | Method and Description |
---|---|
static Dependency[] |
add(Dependency[] deps,
Dependency dep)
Adds an dependency to the give package if it is not already contained in the given list.
|
static Dependency[] |
addExact(Dependency[] deps,
PackageId id)
Adds an exact dependency to the give package if it is not already contained in the given list.
|
static boolean |
matches(Dependency[] deps,
PackageId id)
Checks if any of the dependencies matches the given id
|
static java.util.List<PackageId> |
resolve(java.util.Map<PackageId,Dependency[]> list)
Resolves a list of resolutions respecting their internal dependency references.
|
static <T extends VaultPackage> |
sort(java.util.Collection<T> packages)
Sorts the packages by the dependency order
|
static <T extends JcrPackage> |
sortPackages(java.util.Collection<T> packages)
Sorts the packages by the dependency order
|
public static <T extends VaultPackage> void sort(java.util.Collection<T> packages) throws CyclicDependencyException
T
- Type of the collection.packages
- packages to sortCyclicDependencyException
- if a cyclic dependency is detectedpublic static <T extends JcrPackage> void sortPackages(java.util.Collection<T> packages) throws CyclicDependencyException, RepositoryException
T
- Type of the collection.packages
- packages to sortCyclicDependencyException
- if a cyclic dependency is detectedRepositoryException
- if an repository error occurspublic static java.util.List<PackageId> resolve(java.util.Map<PackageId,Dependency[]> list) throws CyclicDependencyException
list
- list of resolutionsCyclicDependencyException
- if a cyclic dependency is detectedpublic static boolean matches(@Nonnull Dependency[] deps, @Nonnull PackageId id)
deps
- the list of dependenciesid
- the idtrue
if matchespublic static Dependency[] addExact(@Nonnull Dependency[] deps, @Nonnull PackageId id)
deps
- the original dependenciesid
- the id to adddeps
if nothing changed.public static Dependency[] add(@Nonnull Dependency[] deps, @Nonnull Dependency dep)
deps
- the original dependenciesdep
- the dependency to adddeps
if nothing changed.Copyright © 2010 - 2020 Adobe. All Rights Reserved