Class Slices
- java.lang.Object
-
- com.tngtech.archunit.library.dependencies.Slices
-
- All Implemented Interfaces:
DescribedIterable<Slice>,HasDescription,java.lang.Iterable<Slice>
public final class Slices extends java.lang.Object implements DescribedIterable<Slice>
Basic collection ofSlicefor tests on dependencies of package slices, e.g. to avoid cycles. Example to specify aClassesTransformerto runArchRulesagainstSlices:
would group the packagesSlices.matching("some.pkg.(*)..")some.pkg.one.anysome.pkg.one.other
some.pkg.two.any
The resultingClassesTransformercan be used to specify anArchRuleon slices.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSlices.Creatorstatic classSlices.Transformer-
Nested classes/interfaces inherited from interface com.tngtech.archunit.base.DescribedIterable
DescribedIterable.From
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Slicesas(java.lang.String description)java.lang.StringgetDescription()java.util.Iterator<Slice>iterator()static Slices.Transformermatching(java.lang.String packageIdentifier)SlicesnamingSlices(java.lang.String pattern)Allows the naming of single slices, where back references to the matching pattern can be denoted by '$' followed by capturing group number.
-
-
-
Method Detail
-
iterator
public java.util.Iterator<Slice> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<Slice>
-
as
public Slices as(java.lang.String description)
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescriptionin interfaceHasDescription
-
namingSlices
public Slices namingSlices(java.lang.String pattern)
Allows the naming of single slices, where back references to the matching pattern can be denoted by '$' followed by capturing group number.
E.g.namingSlices("Slice $1")would name a slice matching'*..service.(*)..*'against'com.some.company.service.hello.something'as 'Slice hello'.- Parameters:
pattern- The naming pattern, e.g. 'Slice $1'- Returns:
- The same slices with adjusted naming for each single slice
-
matching
public static Slices.Transformer matching(java.lang.String packageIdentifier)
- See Also:
Slices.Creator.matching(String)
-
-