Package de.xima.fc.utils
Class XAnnotationUtils
- java.lang.Object
-
- de.xima.fc.utils.XAnnotationUtils
-
public final class XAnnotationUtils extends Object
Utility methods forAnnotation
.- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
-
-
Constructor Summary
Constructors Constructor Description XAnnotationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <A extends Annotation>
booleanenumConstantHasAnnotation(Enum<?> enumConstant, Class<A> annotationType)
Checks whether an enum constant has a specific annotation.static <A extends Annotation>
AgetEnumConstantAnnotation(Enum<?> enumConstant, Class<A> annotationType)
Get an annotation from an enum constant, i.e.
-
-
-
Method Detail
-
getEnumConstantAnnotation
public static <A extends Annotation> A getEnumConstantAnnotation(Enum<?> enumConstant, Class<A> annotationType)
Get an annotation from an enum constant, i.e. an annotation applied directly to an enum constant.- Type Parameters:
A
- The annotation type.- Parameters:
enumConstant
- The enum constant to get the annotation from.annotationType
- The annotation type to get.- Returns:
- The annotation or null if the annotation is not present.
-
enumConstantHasAnnotation
public static <A extends Annotation> boolean enumConstantHasAnnotation(Enum<?> enumConstant, Class<A> annotationType)
Checks whether an enum constant has a specific annotation.- Type Parameters:
A
- The annotation type.- Parameters:
enumConstant
- The enum constant to get the annotation from.annotationType
- The annotation type to get.- Returns:
- True if the annotation is present, false otherwise.
-
-