All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.badlogic.gdx.utils.reflect.Annotation Maven / Gradle / Ivy

There is a newer version: 1.12.1
Show newest version

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();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy