Class XAnnotation<A extends Annotation>


  • public class XAnnotation<A extends Annotation>
    extends Object
    Defines an xannotation.
    Author:
    Aleksei Valikov
    • Field Detail

      • EMPTY_ARRAY

        public static XAnnotation<?>[] EMPTY_ARRAY
        Empty array of annotations.
    • Constructor Detail

      • XAnnotation

        public XAnnotation​(Class<A> annotationClass,
                           XAnnotationField<?>... fields)
                    throws IllegalArgumentException
        Constructs an xannotation for the given annotation class.
        Parameters:
        annotationClass - annotation class, must not be null
        fields - fields of the xannotation.
        Throws:
        IllegalArgumentException - If annotation class is null, some required annotation fields are missing or some annotation fields have mismatching types.
    • Method Detail

      • getAnnotationClass

        public Class<? extends Annotation> getAnnotationClass()
        Returns the annotation class.
        Returns:
        annotation class.
      • getAnnotationClassName

        public String getAnnotationClassName()
      • getFieldsList

        public List<XAnnotationField<?>> getFieldsList()
        Returns the list of the fields.
        Returns:
        list of the fields.
      • getFieldsMap

        public Map<String,​XAnnotationField<?>> getFieldsMap()
        Returns the map of the fields.
        Returns:
        map of the fields.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getResult

        public A getResult()
        Returns the instance of the annotation for this xannotation.
        Returns:
        Instance of the annotation for this xannotation.