Class ModuleRuleDefinition.PackagesDefinition
java.lang.Object
com.tngtech.archunit.library.modules.syntax.ModuleRuleDefinition.PackagesDefinition
- All Implemented Interfaces:
GivenObjects<ArchModule<ArchModule.Descriptor>>,GivenModules<ArchModule.Descriptor>
- Enclosing class:
- ModuleRuleDefinition
@PublicAPI(usage=ACCESS,
state=EXPERIMENTAL)
public static final class ModuleRuleDefinition.PackagesDefinition
extends Object
implements GivenModules<ArchModule.Descriptor>
-
Method Summary
Modifier and TypeMethodDescriptionAllows to adjust the description of the "given modules" part.derivingNameFromPattern(String namePattern) should()Allows to specify assertions for the set ofArchModules under consideration.should(ArchCondition<? super ArchModule<ArchModule.Descriptor>> condition) Allows to form a rule by passing a condition the objects under consideration must satisfy.that(DescribedPredicate<? super ArchModule<ArchModule.Descriptor>> predicate) Allows to restrict the set of objects under consideration.
-
Method Details
-
derivingNameFromPattern
@PublicAPI(usage=ACCESS, state=EXPERIMENTAL) public ModuleRuleDefinition.PackagesDefinition derivingNameFromPattern(String namePattern) -
should
Description copied from interface:GivenObjectsAllows to form a rule by passing a condition the objects under consideration must satisfy. E.g.
all(customObjects).should(behaveAsExpected())- Specified by:
shouldin interfaceGivenObjects<ArchModule<ArchModule.Descriptor>>- Returns:
- An
ArchRulewhich can be evaluated on importedJavaClasses
-
that
public GivenModulesConjunction<ArchModule.Descriptor> that(DescribedPredicate<? super ArchModule<ArchModule.Descriptor>> predicate) Description copied from interface:GivenObjectsAllows to restrict the set of objects under consideration. E.g.
Note that many predefinedall(customObjects).that(predicate)predicatescan be found within a subclassPredicatesof the respective domain object or a common ancestor. For example,predicatestargetingJavaClasscan be found withinJavaClass.Predicatesor one of the respective ancestors likeHasName.Predicates.- Specified by:
thatin interfaceGivenModules<ArchModule.Descriptor>- Specified by:
thatin interfaceGivenObjects<ArchModule<ArchModule.Descriptor>>- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
should
Description copied from interface:GivenModulesAllows to specify assertions for the set ofArchModules under consideration. E.g.
modules().should().respectTheirAllowedDependencies(..)
UseGivenObjects.should(ArchCondition)to freely customize the condition against which theArchModules should be checked.- Specified by:
shouldin interfaceGivenModules<ArchModule.Descriptor>- Returns:
- A syntax element, which can be used to create rules for the
ArchModules under consideration
-
as
Description copied from interface:GivenModulesAllows to adjust the description of the "given modules" part. E.g.
would yield a rule text "App Modules should...".modules().definedByAnnotation(AppModule.class).as("App Modules").should()...- Specified by:
asin interfaceGivenModules<ArchModule.Descriptor>
-