/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */
package net.ranides.assira.reflection;

import java.lang.annotation.Annotation;
import java.util.Optional;
import java.util.function.Predicate;
import net.ranides.assira.reflection.impl.AAnnotations;
import net.ranides.assira.reflection.impl.FElements;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public interface IAnnotations extends IElements<Annotation> {
    
    @SafeVarargs
    static IAnnotations of(Class<? extends Annotation>... annotations) {
        return FElements.newAnnotations(annotations);
    }
    
    static IAnnotations of(Annotation... annotations) {
        return FElements.newAnnotations(annotations);
    }
    
    static IAnnotations of() {
        return AAnnotations.EMPTY;
    }
    
    <A extends Annotation> Optional<A> first(Class<A> type);
    
    IAnnotations require(Predicate<? super Annotation> predicate);
    
    IAnnotations require(Class<? extends Annotation> type);
    
    IAnnotations discard(Predicate<? super Annotation> predicate);
    
    IAnnotations discard(Class<? extends Annotation> type);
            
}
