Package com.tngtech.archunit.core.domain
Class JavaClasses
java.lang.Object
com.tngtech.archunit.base.ForwardingCollection<JavaClass>
com.tngtech.archunit.core.domain.JavaClasses
- All Implemented Interfaces:
DescribedIterable<JavaClass>
,HasDescription
,CanOverrideDescription<JavaClasses>
,Iterable<JavaClass>
,Collection<JavaClass>
public final class JavaClasses
extends ForwardingCollection<JavaClass>
implements DescribedIterable<JavaClass>, CanOverrideDescription<JavaClasses>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tngtech.archunit.base.DescribedIterable
DescribedIterable.From
-
Method Summary
Modifier and TypeMethodDescriptionAllows to adjust the description of this object.boolean
boolean
boolean
containPackage
(String packageName) protected Collection<JavaClass>
delegate()
boolean
getPackage
(String packageName) int
hashCode()
that
(DescribedPredicate<? super JavaClass> predicate) toString()
Methods inherited from class com.tngtech.archunit.base.ForwardingCollection
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
Method Details
-
that
- Parameters:
predicate
- aDescribedPredicate
to determine which classes match- Returns:
JavaClasses
matching the given predicate; the description will be adjusted according to the predicate's description
-
as
Description copied from interface:CanOverrideDescription
Allows to adjust the description of this object. Note that this method will not modify the current object, but instead return a new object with adjusted description.- Specified by:
as
in interfaceCanOverrideDescription<JavaClasses>
- Parameters:
description
- The description the result of this method will hold- Returns:
- A new equivalent object with adjusted description
-
getDescription
- Specified by:
getDescription
in interfaceHasDescription
-
toString
- Overrides:
toString
in classForwardingCollection<JavaClass>
-
contain
-
get
-
contain
- Parameters:
typeName
- a fully qualified name of a Java class- Returns:
- true, if a
JavaClass
with the given name is contained, false otherwise - See Also:
-
get
- Parameters:
typeName
- a fully qualified name of a Java class- Returns:
- a
JavaClass
with the given name; throws an exception if there is no class with the given name - See Also:
-
containPackage
- Parameters:
packageName
- name of a package, may consist of several parts, e.g.com.myapp.some.subpackage
- Returns:
- true, if some package with this name is contained, false otherwise
-
getPackage
- Parameters:
packageName
- name of a package, may consist of several parts, e.g.com.myapp.some.subpackage
- Returns:
- the package with the given name; throws an exception if the package does not exist
- See Also:
-
getDefaultPackage
- Returns:
- the default package, i.e. the root of all packages. The default package name ist the empty string.
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<JavaClass>
- Overrides:
hashCode
in classForwardingCollection<JavaClass>
-
equals
- Specified by:
equals
in interfaceCollection<JavaClass>
- Overrides:
equals
in classForwardingCollection<JavaClass>
-
delegate
- Specified by:
delegate
in classForwardingCollection<JavaClass>
-