1 22 package org.jboss.metadata.spi.retrieval.simple; 23 24 import java.lang.annotation.Annotation ; 25 26 import org.jboss.metadata.spi.retrieval.AnnotationItem; 27 28 35 public class SimpleAnnotationItem<T extends Annotation > extends SimpleMetaDataItem<T> implements AnnotationItem<T> 36 { 37 42 public SimpleAnnotationItem(T annotation) 43 { 44 super(annotation.annotationType().getName(),annotation); 45 } 46 47 public T getAnnotation() 48 { 49 return getValue(); 50 } 51 52 public boolean equals(Object object) 53 { 54 if (object == this) 55 return true; 56 if (object == null || object instanceof AnnotationItem == false) 57 return false; 58 59 AnnotationItem other = (AnnotationItem) object; 60 return getAnnotation().annotationType().equals(other.getAnnotation().annotationType()); 61 } 62 } 63 | Popular Tags |