001package org.kohsuke.stapler.lang;
002
003import java.lang.annotation.Annotation;
004
005/**
006 * @author Kohsuke Kawaguchi
007 */
008public abstract class AnnotatedRef {
009    // no subtyping outside the package
010    /*package*/ AnnotatedRef() {}
011
012    public abstract <T extends Annotation> T getAnnotation(Class<T> type);
013
014    public boolean hasAnnotation(Class<? extends Annotation> type) {
015        return getAnnotation(type)!=null;
016    }
017}