Package org.apache.sling.feature
Class Artifacts
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<Artifact>
-
- org.apache.sling.feature.Artifacts
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Artifact>,Collection<Artifact>,List<Artifact>,RandomAccess
- Direct Known Subclasses:
Bundles
public class Artifacts extends ArrayList<Artifact>
Groups a list ofArtifacts. This class is not thread-safe.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description Artifacts()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(Artifact artifact)Add an artifact.booleancontainsExact(ArtifactId id)Checks whether the exact artifact is availablebooleancontainsSame(ArtifactId id)Checks whether the same artifact is available, neglecting the versionArtifactgetExact(ArtifactId id)Get the artifact for the given idArtifactgetSame(ArtifactId id)Get the artifact for the given id, neglecting the versionbooleanremoveExact(ArtifactId id)Remove 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, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
Method Detail
-
add
public boolean add(Artifact artifact)
Add an artifact. If the exact artifact is already contained in the collection, it is not added again.
-
removeExact
public boolean removeExact(ArtifactId id)
Remove the exact artifact. The first one found is removed.- Parameters:
id- The artifact id- Returns:
trueif the artifact has been removed
-
removeSame
public boolean removeSame(ArtifactId id)
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
public Artifact getSame(ArtifactId id)
Get the artifact for the given id, neglecting the version- Parameters:
id- The artifact id- Returns:
- The artifact or
nullotherwise
-
getExact
public Artifact getExact(ArtifactId id)
Get the artifact for the given id- Parameters:
id- The artifact id- Returns:
- The artifact or
nullotherwise
-
containsExact
public boolean containsExact(ArtifactId id)
Checks whether the exact artifact is available- Parameters:
id- The artifact id.- Returns:
trueif the artifact exists
-
containsSame
public boolean containsSame(ArtifactId id)
Checks whether the same artifact is available, neglecting the version- Parameters:
id- The artifact id.- Returns:
trueif the artifact exists
-
-