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>
,java.lang.Iterable<JavaClass>
,java.util.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 Type Method Description JavaClasses
as(java.lang.String description)
Allows to adjust the description of this object.boolean
contain(java.lang.Class<?> reflectedType)
boolean
contain(java.lang.String typeName)
boolean
containPackage(java.lang.String packageName)
protected java.util.Collection<JavaClass>
delegate()
boolean
equals(java.lang.Object obj)
JavaClass
get(java.lang.Class<?> reflectedType)
JavaClass
get(java.lang.String typeName)
JavaPackage
getDefaultPackage()
java.lang.String
getDescription()
JavaPackage
getPackage(java.lang.String packageName)
int
hashCode()
JavaClasses
that(DescribedPredicate<? super JavaClass> predicate)
java.lang.String
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
Methods inherited from interface java.lang.Iterable
forEach
-
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
public java.lang.String getDescription()- Specified by:
getDescription
in interfaceHasDescription
-
toString
public java.lang.String toString()- Overrides:
toString
in classForwardingCollection<JavaClass>
-
contain
- Parameters:
reflectedType
- a JavaClass
object- Returns:
- true, if an equivalent
JavaClass
is contained, false otherwise - See Also:
get(Class)
,contain(String)
-
get
- Parameters:
reflectedType
- a JavaClass
object- Returns:
- a
JavaClass
equivalent to the given type; throws an exception if there is no equivalent class - See Also:
contain(Class)
,get(String)
-
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(String)
,contain(Class)
-
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:
contain(Class)
,get(Class)
-
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:
containPackage(String)
-
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 interfacejava.util.Collection<JavaClass>
- Overrides:
hashCode
in classForwardingCollection<JavaClass>
-
equals
public boolean equals(java.lang.Object obj)- Specified by:
equals
in interfacejava.util.Collection<JavaClass>
- Overrides:
equals
in classForwardingCollection<JavaClass>
-
delegate
- Specified by:
delegate
in classForwardingCollection<JavaClass>
-