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

uk.autores.processors.AnnotationDef Maven / Gradle / Ivy

There is a newer version: 11.0.35-beta
Show newest version
// Copyright 2024 https://github.com/autores-uk/autores/blob/main/LICENSE.txt
// SPDX-License-Identifier: Apache-2.0
package uk.autores.processors;

import javax.annotation.processing.ProcessingEnvironment;
import java.lang.annotation.Annotation;
import java.util.stream.Stream;

final class AnnotationDef {
    final Class single;
    final Class repeating;
    final F factory;

    public AnnotationDef(Class single, Class repeating, F factory) {
        this.single = single;
        this.repeating = repeating;
        this.factory = factory;
    }

    Stream> annotations() {
        return Stream.of(single, repeating);
    }

    @FunctionalInterface
    interface F {
        ContextFactory create(ProcessingEnvironment env);
    }
}