public class Predicates extends Object
Modifier and Type | Method and 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 type
clazz and has given modifiers. |
static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> |
arePublicFinalOfType(Class<?> clazz)
Tests that the given field is
public final and not static and of the given
type clazz . |
static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> |
arePublicFinalOfTypeWithAnnotation(Class<?> clazz,
Class<? extends Annotation> annotationType)
Tests that the given field is
public final and of the given type clazz with
exactly the given annotationType . |
static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> |
arePublicStaticFinalAssignableTo(Class<?> clazz)
Tests that the given field is
public static final and is assignable to the given type
clazz . |
static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> |
arePublicStaticFinalOfType(Class<?> clazz)
Tests that the given field is
public static final and of the given type clazz
. |
static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> |
arePublicStaticFinalOfTypeWithAnnotation(Class<?> clazz,
Class<? extends Annotation> annotationType)
Tests that the given field is
public static final and of the given type clazz
with exactly the given annotationType . |
static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> |
arePublicStaticOfType(Class<?> clazz)
Tests that the given field is
public static and of the given type clazz . |
static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> |
areStaticFinalOfTypeWithAnnotation(Class<?> clazz,
Class<? extends Annotation> annotationType)
Tests that the given field is
static final and of the given type clazz with
exactly the given annotationType . |
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 a
DescribedPredicate that returns true if one and only one of the given
predicates match. |
@SafeVarargs public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaClass> areDirectlyAnnotatedWithAtLeastOneOf(Class<? extends Annotation>... annotations)
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)
DescribedPredicate
returning true, if and only if the predicate JavaField
could be found in the JavaClass
.public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> arePublicStaticOfType(Class<?> clazz)
public static
and of the given type clazz
.
Attention: changing the description will add a rule into the stored.rules.
public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> areFieldOfType(Class<?> clazz, com.tngtech.archunit.core.domain.JavaModifier... modifiers)
clazz
and has given modifiers.
Attention: changing the description will add a rule into the stored.rules.
public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> arePublicFinalOfType(Class<?> clazz)
public final
and not static
and of the given
type clazz
.public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> arePublicStaticFinalAssignableTo(Class<?> clazz)
public static final
and is assignable to the given type
clazz
.public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> arePublicStaticFinalOfType(Class<?> clazz)
public static final
and of the given type clazz
.public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> arePublicFinalOfTypeWithAnnotation(Class<?> clazz, Class<? extends Annotation> annotationType)
public final
and of the given type clazz
with
exactly the given annotationType
.public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> arePublicStaticFinalOfTypeWithAnnotation(Class<?> clazz, Class<? extends Annotation> annotationType)
public static final
and of the given type clazz
with exactly the given annotationType
.public static com.tngtech.archunit.base.DescribedPredicate<com.tngtech.archunit.core.domain.JavaField> areStaticFinalOfTypeWithAnnotation(Class<?> clazz, Class<? extends Annotation> annotationType)
static final
and of the given type clazz
with
exactly the given annotationType
. It doesn't matter if public, private or protected.@SafeVarargs public static <T> com.tngtech.archunit.base.DescribedPredicate<T> exactlyOneOf(com.tngtech.archunit.base.DescribedPredicate<? super T>... other)
DescribedPredicate
that returns true if one and only one of the given
predicates match.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.