Class Slices.Transformer
java.lang.Object
com.tngtech.archunit.library.dependencies.Slices.Transformer
- All Implemented Interfaces:
HasDescription
,ClassesTransformer<Slice>
- Enclosing class:
- Slices
public static class Slices.Transformer extends java.lang.Object implements ClassesTransformer<Slice>
Specifies how to transform a set of
JavaClass
into a set of Slice
, e.g. to test that
no cycles between certain package slices appear.- See Also:
Slices
-
Method Summary
Modifier and Type Method Description Slices.Transformer
as(java.lang.String description)
java.lang.String
getDescription()
Slices
of(JavaClasses classes)
Slices.Transformer
that(DescribedPredicate<? super Slice> predicate)
Can be used to further filter the transformation result.Slices
transform(JavaClasses classes)
Defines how to transform importedJavaClasses
to the respective objects to test.Slices
transform(java.lang.Iterable<Dependency> dependencies)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
as
- Specified by:
as
in interfaceClassesTransformer<Slice>
- Parameters:
description
- A new description for this transformer- Returns:
- A transformer for the same transformation with an adjusted description
-
of
-
transform
-
transform
Description copied from interface:ClassesTransformer
Defines how to transform importedJavaClasses
to the respective objects to test.- Specified by:
transform
in interfaceClassesTransformer<Slice>
- Parameters:
classes
- ImportedJavaClasses
- Returns:
- A
DescribedIterable
holding the transformed objects - See Also:
Slices.Transformer
-
that
Description copied from interface:ClassesTransformer
Can be used to further filter the transformation result.- Specified by:
that
in interfaceClassesTransformer<Slice>
- Parameters:
predicate
- Predicate to filter the collection of transformed objects- Returns:
- A transformer that additionally filters the transformed result
-
getDescription
public java.lang.String getDescription()- Specified by:
getDescription
in interfaceHasDescription
-