Package org.apache.sling.feature
Class Artifacts
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Artifact>,Collection<Artifact>,List<Artifact>,RandomAccess
- Direct Known Subclasses:
Bundles
Groups a list of
Artifacts.
This class is not thread-safe.- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdd an artifact.booleanChecks whether the exact artifact is availablebooleanChecks whether the same artifact is available, neglecting the versiongetExact(ArtifactId id) Get the artifact for the given idgetSame(ArtifactId id) Get the artifact for the given id, neglecting the versionbooleanRemove the exact artifact.booleanremoveSame(ArtifactId id) Remove the same artifact, neglecting the version.Methods inherited from class java.util.ArrayList
add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractList
equals, hashCodeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, streamMethods inherited from interface java.util.List
containsAll, equals, hashCode
-
Constructor Details
-
Artifacts
public Artifacts()
-
-
Method Details
-
add
Add an artifact. If the exact artifact is already contained in the collection, it is not added again. -
removeExact
Remove the exact artifact. The first one found is removed.- Parameters:
id- The artifact id- Returns:
trueif the artifact has been removed
-
removeSame
Remove the same artifact, neglecting the version. The first one found is removed.- Parameters:
id- The artifact id- Returns:
trueif the artifact has been removed
-
getSame
Get the artifact for the given id, neglecting the version- Parameters:
id- The artifact id- Returns:
- The artifact or
nullotherwise
-
getExact
Get the artifact for the given id- Parameters:
id- The artifact id- Returns:
- The artifact or
nullotherwise
-
containsExact
Checks whether the exact artifact is available- Parameters:
id- The artifact id.- Returns:
trueif the artifact exists
-
containsSame
Checks whether the same artifact is available, neglecting the version- Parameters:
id- The artifact id.- Returns:
trueif the artifact exists
-