Class ArchModule<DESCRIPTOR extends ArchModule.Descriptor>
java.lang.Object
com.tngtech.archunit.base.ForwardingCollection<T>
com.tngtech.archunit.base.ForwardingSet<JavaClass>
com.tngtech.archunit.library.modules.ArchModule<DESCRIPTOR>
@PublicAPI(usage=ACCESS,
state=EXPERIMENTAL)
public final class ArchModule<DESCRIPTOR extends ArchModule.Descriptor>
extends ForwardingSet<JavaClass>
implements HasName
Represents a generic "architecture module", i.e. any group of classes that should form a cohesive unit.
An
To create
An
ArchModule can be identified by its identifier. Vice versa an ArchModule
can be defined as a mapping JavaClass -> ArchModule.Identifier, where all classes that are mapped to the
same identifier will end up in the same module.ArchModule offers an API to obtain all class dependencies, i.e.
all dependencies from classes within the module to classes
outside of the module. It also offers an API to obtain all module dependencies,
i.e. dependencies from this ArchModule to another ArchModule where these dependencies reflect
all class dependencies where the origin resides within this ArchModule
and the target resides within another ArchModule.
To create
ArchModules please refer to ArchModules.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceContains meta-information for anArchModule.static final classAnArchModule.Identifierof anArchModule.Nested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.HasName
HasName.AndFullName, HasName.Functions, HasName.Predicates, HasName.Utils -
Method Summary
Methods inherited from class com.tngtech.archunit.base.ForwardingCollection
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArrayMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Method Details
-
delegate
- Specified by:
delegatein classForwardingSet<JavaClass>
-
getIdentifier
- Returns:
- The
ArchModule.Identifierof this module
-
getName
-
getDescriptor
- Returns:
- The
ArchModule.Descriptorof thisArchModule
-
getClassDependenciesFromSelf
- Returns:
- All
dependencieswhere theorigin classis contained within thisArchModule.
-
getClassDependenciesToSelf
- Returns:
- All
dependencieswhere thetarget classis contained within thisArchModule.
-
getModuleDependenciesFromSelf
@PublicAPI(usage=ACCESS, state=EXPERIMENTAL) public Set<ModuleDependency<DESCRIPTOR>> getModuleDependenciesFromSelf()- Returns:
- All
module dependencieswhere theoriginequals thisArchModule.
-
getModuleDependenciesToSelf
@PublicAPI(usage=ACCESS, state=EXPERIMENTAL) public Set<ModuleDependency<DESCRIPTOR>> getModuleDependenciesToSelf()- Returns:
- All
module dependencieswhere thetargetequals thisArchModule.
-
getUndefinedDependencies
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<DESCRIPTOR extends ArchModule.Descriptor>- Specified by:
hashCodein interfaceSet<DESCRIPTOR extends ArchModule.Descriptor>- Overrides:
hashCodein classForwardingCollection<JavaClass>
-
equals
- Specified by:
equalsin interfaceCollection<DESCRIPTOR extends ArchModule.Descriptor>- Specified by:
equalsin interfaceSet<DESCRIPTOR extends ArchModule.Descriptor>- Overrides:
equalsin classForwardingCollection<JavaClass>
-
toString
- Overrides:
toStringin classForwardingCollection<JavaClass>
-