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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JavaClassesas(java.lang.String description)Allows to adjust the description of this object.booleancontain(java.lang.Class<?> reflectedType)booleancontain(java.lang.String typeName)booleancontainPackage(java.lang.String packageName)protected java.util.Collection<JavaClass>delegate()booleanequals(java.lang.Object obj)JavaClassget(java.lang.Class<?> reflectedType)JavaClassget(java.lang.String typeName)JavaPackagegetDefaultPackage()java.lang.StringgetDescription()JavaPackagegetPackage(java.lang.String packageName)inthashCode()JavaClassesthat(DescribedPredicate<? super JavaClass> predicate)java.lang.StringtoString()-
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
-
-
-
-
Method Detail
-
that
@PublicAPI(usage=ACCESS) public JavaClasses that(DescribedPredicate<? super JavaClass> predicate)
- Parameters:
predicate- aDescribedPredicateto determine which classes match- Returns:
JavaClassesmatching the given predicate; the description will be adjusted according to the predicate's description
-
as
public JavaClasses as(java.lang.String description)
Description copied from interface:CanOverrideDescriptionAllows 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:
asin 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:
getDescriptionin interfaceHasDescription
-
toString
public java.lang.String toString()
- Overrides:
toStringin classForwardingCollection<JavaClass>
-
contain
@PublicAPI(usage=ACCESS) public boolean contain(java.lang.Class<?> reflectedType)
- Parameters:
reflectedType- a JavaClassobject- Returns:
- true, if an equivalent
JavaClassis contained, false otherwise - See Also:
get(Class),contain(String)
-
get
@PublicAPI(usage=ACCESS) public JavaClass get(java.lang.Class<?> reflectedType)
- Parameters:
reflectedType- a JavaClassobject- Returns:
- a
JavaClassequivalent to the given type; throws an exception if there is no equivalent class - See Also:
contain(Class),get(String)
-
contain
@PublicAPI(usage=ACCESS) public boolean contain(java.lang.String typeName)
- Parameters:
typeName- a fully qualified name of a Java class- Returns:
- true, if a
JavaClasswith the given name is contained, false otherwise - See Also:
get(String),contain(Class)
-
get
@PublicAPI(usage=ACCESS) public JavaClass get(java.lang.String typeName)
- Parameters:
typeName- a fully qualified name of a Java class- Returns:
- a
JavaClasswith the given name; throws an exception if there is no class with the given name - See Also:
contain(Class),get(Class)
-
containPackage
@PublicAPI(usage=ACCESS) public boolean containPackage(java.lang.String packageName)
- 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
@PublicAPI(usage=ACCESS) public JavaPackage getPackage(java.lang.String packageName)
- 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
@PublicAPI(usage=ACCESS) public JavaPackage 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:
hashCodein interfacejava.util.Collection<JavaClass>- Overrides:
hashCodein classForwardingCollection<JavaClass>
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin interfacejava.util.Collection<JavaClass>- Overrides:
equalsin classForwardingCollection<JavaClass>
-
delegate
protected java.util.Collection<JavaClass> delegate()
- Specified by:
delegatein classForwardingCollection<JavaClass>
-
-