JingGe commented on a change in pull request #18333: URL: https://github.com/apache/flink/pull/18333#discussion_r784063682
########## File path: flink-architecture-tests/src/test/java/org/apache/flink/architecture/common/Predicates.java ########## @@ -50,5 +83,78 @@ && field.getRawType().isEquivalentTo(clazz)); } + /** + * Tests that the given field is {@code public final} and not {@code static} and of the given + * type {@code clazz} . + */ + public static DescribedPredicate<JavaField> arePublicFinalOfTyp(Class<?> clazz) { + return is(ofType(clazz)).and(isPublic()).and(isFinal()).and(isNotStatic()); + } + + /** + * Tests that the given field is {@code public static final} and of the given type {@code clazz} + * . + */ + public static DescribedPredicate<JavaField> arePublicStaticFinalOfTyp(Class<?> clazz) { + return arePublicStaticOfType(clazz).and(isFinal()); + } + + /** + * Tests that the given field is {@code public final} and of the given type {@code clazz} with + * exactly the given {@code annotationType}. + */ + public static DescribedPredicate<JavaField> arePublicFinalOfTypeWithAnnotation( + Class<?> clazz, Class<? extends Annotation> annotationType) { + return arePublicFinalOfTyp(clazz).and(annotatedWith(annotationType)); + } + + /** + * Tests that the given field is {@code public static final} and of the given type {@code clazz} + * with exactly the given {@code annotationType}. + */ + public static DescribedPredicate<JavaField> arePublicStaticFinalOfTypeWithAnnotation( + Class<?> clazz, Class<? extends Annotation> annotationType) { + return arePublicStaticFinalOfTyp(clazz).and(annotatedWith(annotationType)); + } + + /** + * Tests that the given field is {@code public static final} and of the given type. It must have + * any of the given {@code annotationTypes} + */ + @SafeVarargs + public static DescribedPredicate<JavaField> arePublicStaticFinalOfTypeWithOneOfAnnotations( Review comment: I have nothing to against removing unused code. It was committed it to provide convenience for further development. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org