Class ArchModule<DESCRIPTOR extends ArchModule.Descriptor>
java.lang.Object
com.tngtech.archunit.base.ForwardingCollection<JavaClass>
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
ArchModule
s please refer to ArchModules
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Contains meta-information for anArchModule
.static final class
AnArchModule.Identifier
of 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, 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, stream, toArray
-
Method Details
-
delegate
- Specified by:
delegate
in classForwardingSet<JavaClass>
-
getIdentifier
- Returns:
- The
ArchModule.Identifier
of this module
-
getName
-
getDescriptor
- Returns:
- The
ArchModule.Descriptor
of thisArchModule
-
getClassDependenciesFromSelf
- Returns:
- All
dependencies
where theorigin class
is contained within thisArchModule
.
-
getClassDependenciesToSelf
- Returns:
- All
dependencies
where thetarget class
is contained within thisArchModule
.
-
getModuleDependenciesFromSelf
@PublicAPI(usage=ACCESS, state=EXPERIMENTAL) public Set<ModuleDependency<DESCRIPTOR>> getModuleDependenciesFromSelf()- Returns:
- All
module dependencies
where theorigin
equals thisArchModule
.
-
getModuleDependenciesToSelf
@PublicAPI(usage=ACCESS, state=EXPERIMENTAL) public Set<ModuleDependency<DESCRIPTOR>> getModuleDependenciesToSelf()- Returns:
- All
module dependencies
where thetarget
equals thisArchModule
.
-
getUndefinedDependencies
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<DESCRIPTOR extends ArchModule.Descriptor>
- Specified by:
hashCode
in interfaceSet<DESCRIPTOR extends ArchModule.Descriptor>
- Overrides:
hashCode
in classForwardingCollection<JavaClass>
-
equals
- Specified by:
equals
in interfaceCollection<DESCRIPTOR extends ArchModule.Descriptor>
- Specified by:
equals
in interfaceSet<DESCRIPTOR extends ArchModule.Descriptor>
- Overrides:
equals
in classForwardingCollection<JavaClass>
-
toString
- Overrides:
toString
in classForwardingCollection<JavaClass>
-