Package com.helger.commons.cache
Class AnnotationUsageCache
- java.lang.Object
-
- com.helger.commons.cache.AnnotationUsageCache
-
- All Implemented Interfaces:
Serializable
@ThreadSafe public class AnnotationUsageCache extends Object implements Serializable
A simple cache for the usage of a certain annotation class at other classes.
Note: cannot useCachebecause it would need aClass<?>as a key and this would be a hard wired reference.- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AnnotationUsageCache(Class<? extends Annotation> aAnnotationClass)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearCache()Class<? extends Annotation>getAnnotationClass()booleanhasAnnotation(Class<?> aClass)booleanhasAnnotation(Object aObject)voidsetAnnotation(Class<?> aClass, boolean bHasAnnotation)StringtoString()
-
-
-
Constructor Detail
-
AnnotationUsageCache
public AnnotationUsageCache(@Nonnull Class<? extends Annotation> aAnnotationClass)
Constructor- Parameters:
aAnnotationClass- The annotation class to store the existence of. It must have theRetentionPolicy.RUNTIMEto be usable within this class!
-
-
Method Detail
-
getAnnotationClass
@Nonnull public final Class<? extends Annotation> getAnnotationClass()
- Returns:
- The annotation class passed in the constructor. Never
null.
-
clearCache
public void clearCache()
-
-