com.badlogic.gdx.utils.reflect.Annotation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gdx Show documentation
Show all versions of gdx Show documentation
Android/Desktop/iOS/HTML5 game development framework
package com.badlogic.gdx.utils.reflect;
/** Provides information about, and access to, an annotation of a field, class or interface.
* @author dludwig */
public final class Annotation {
private java.lang.annotation.Annotation annotation;
Annotation (java.lang.annotation.Annotation annotation) {
this.annotation = annotation;
}
@SuppressWarnings("unchecked")
public T getAnnotation (Class annotationType) {
if (annotation.annotationType().equals(annotationType)) {
return (T)annotation;
}
return null;
}
public Class getAnnotationType () {
return annotation.annotationType();
}
}