Class Predicates
- java.lang.Object
-
- org.apache.flink.architecture.common.Predicates
-
public class Predicates extends Object
Common predicates for architecture tests.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaClass>areDirectlyAnnotatedWithAtLeastOneOf(Class<? extends Annotation>... annotations)static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField>areFieldOfType(Class<?> clazz, com.tngtech.archunit.core.domain.JavaModifier... modifiers)Tests that the given field is of the given typeclazzand has given modifiers.static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField>arePublicFinalOfType(Class<?> clazz)Tests that the given field ispublic finaland notstaticand of the given typeclazz.static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField>arePublicFinalOfTypeWithAnnotation(Class<?> clazz, Class<? extends Annotation> annotationType)Tests that the given field ispublic finaland of the given typeclazzwith exactly the givenannotationType.static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField>arePublicStaticFinalAssignableTo(Class<?> clazz)Tests that the given field ispublic static finaland is assignable to the given typeclazz.static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField>arePublicStaticFinalOfType(Class<?> clazz)Tests that the given field ispublic static finaland of the given typeclazz.static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField>arePublicStaticFinalOfTypeWithAnnotation(Class<?> clazz, Class<? extends Annotation> annotationType)Tests that the given field ispublic static finaland of the given typeclazzwith exactly the givenannotationType.static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField>arePublicStaticOfType(Class<?> clazz)Tests that the given field ispublic staticand of the given typeclazz.static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField>areStaticFinalOfTypeWithAnnotation(Class<?> clazz, Class<? extends Annotation> annotationType)Tests that the given field isstatic finaland of the given typeclazzwith exactly the givenannotationType.static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaClass>containAnyFieldsInClassHierarchyThat(com.tngtech.archunit.base.DescribedPredicate<? super com.tngtech.archunit.core.domain.JavaField> predicate)static <T> com.tngtech.archunit.base.DescribedPredicate<T>exactlyOneOf(com.tngtech.archunit.base.DescribedPredicate<? super T>... other)Returns aDescribedPredicatethat returns true if one and only one of the given predicates match.
-
-
-
Method Detail
-
areDirectlyAnnotatedWithAtLeastOneOf
@SafeVarargs public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaClass> areDirectlyAnnotatedWithAtLeastOneOf(Class<? extends Annotation>... annotations)
-
containAnyFieldsInClassHierarchyThat
public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaClass> containAnyFieldsInClassHierarchyThat(com.tngtech.archunit.base.DescribedPredicate<? super com.tngtech.archunit.core.domain.JavaField> predicate)
- Returns:
- A
DescribedPredicatereturning true, if and only if the predicateJavaFieldcould be found in theJavaClass.
-
arePublicStaticOfType
public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> arePublicStaticOfType(Class<?> clazz)
Tests that the given field ispublic staticand of the given typeclazz.Attention: changing the description will add a rule into the stored.rules.
-
areFieldOfType
public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> areFieldOfType(Class<?> clazz, com.tngtech.archunit.core.domain.JavaModifier... modifiers)
Tests that the given field is of the given typeclazzand has given modifiers.Attention: changing the description will add a rule into the stored.rules.
-
arePublicFinalOfType
public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> arePublicFinalOfType(Class<?> clazz)
Tests that the given field ispublic finaland notstaticand of the given typeclazz.
-
arePublicStaticFinalAssignableTo
public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> arePublicStaticFinalAssignableTo(Class<?> clazz)
Tests that the given field ispublic static finaland is assignable to the given typeclazz.
-
arePublicStaticFinalOfType
public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> arePublicStaticFinalOfType(Class<?> clazz)
Tests that the given field ispublic static finaland of the given typeclazz.
-
arePublicFinalOfTypeWithAnnotation
public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> arePublicFinalOfTypeWithAnnotation(Class<?> clazz, Class<? extends Annotation> annotationType)
Tests that the given field ispublic finaland of the given typeclazzwith exactly the givenannotationType.
-
arePublicStaticFinalOfTypeWithAnnotation
public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> arePublicStaticFinalOfTypeWithAnnotation(Class<?> clazz, Class<? extends Annotation> annotationType)
Tests that the given field ispublic static finaland of the given typeclazzwith exactly the givenannotationType.
-
areStaticFinalOfTypeWithAnnotation
public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> areStaticFinalOfTypeWithAnnotation(Class<?> clazz, Class<? extends Annotation> annotationType)
Tests that the given field isstatic finaland of the given typeclazzwith exactly the givenannotationType. It doesn't matter if public, private or protected.
-
exactlyOneOf
@SafeVarargs public static <T> com.tngtech.archunit.base.DescribedPredicate<T> exactlyOneOf(com.tngtech.archunit.base.DescribedPredicate<? super T>... other)
Returns aDescribedPredicatethat returns true if one and only one of the given predicates match.
-
-