Package com.tngtech.archunit.lang
Class AbstractClassesTransformer<T>
java.lang.Object
com.tngtech.archunit.lang.AbstractClassesTransformer<T>
- All Implemented Interfaces:
HasDescription
,ClassesTransformer<T>
@PublicAPI(usage=INHERITANCE) public abstract class AbstractClassesTransformer<T> extends java.lang.Object implements ClassesTransformer<T>
Default base implementation of
ClassesTransformer
, where only doTransform(JavaClasses)
has to be implemented, while description and filtering via that(DescribedPredicate)
are provided.-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractClassesTransformer(java.lang.String description)
-
Method Summary
Modifier and Type Method Description ClassesTransformer<T>
as(java.lang.String description)
abstract java.lang.Iterable<T>
doTransform(JavaClasses collection)
java.lang.String
getDescription()
ClassesTransformer<T>
that(DescribedPredicate<? super T> predicate)
Can be used to further filter the transformation result.java.lang.String
toString()
DescribedIterable<T>
transform(JavaClasses collection)
Defines how to transform importedJavaClasses
to the respective objects to test.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
AbstractClassesTransformer
protected AbstractClassesTransformer(java.lang.String description)
-
-
Method Details
-
transform
Description copied from interface:ClassesTransformer
Defines how to transform importedJavaClasses
to the respective objects to test.- Specified by:
transform
in interfaceClassesTransformer<T>
- Parameters:
collection
- ImportedJavaClasses
- Returns:
- A
DescribedIterable
holding the transformed objects - See Also:
Slices.Transformer
-
doTransform
-
that
Description copied from interface:ClassesTransformer
Can be used to further filter the transformation result.- Specified by:
that
in interfaceClassesTransformer<T>
- Parameters:
predicate
- Predicate to filter the collection of transformed objects- Returns:
- A transformer that additionally filters the transformed result
-
getDescription
public final java.lang.String getDescription()- Specified by:
getDescription
in interfaceHasDescription
-
as
- Specified by:
as
in interfaceClassesTransformer<T>
- Parameters:
description
- A new description for this transformer- Returns:
- A transformer for the same transformation with an adjusted description
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-