Skip to content

Commit

Permalink
Add Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Almighty-Satan committed Oct 27, 2023
1 parent 68710ed commit 09d4b70
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,28 @@

public interface AnnotationManager {

/**
* Adds an annotation that can than be used to validate config entries.
* Some annotations are registered by default (see {@link Validate})
*
* @param annotationClass the class of the annotation
* @param validatorFunction a function (annotation) -> {@link Validator}
* @param <A> the annotation
* @param <T> the type of the validator
* @throws IllegalArgumentException if the given class is not an annotation
*/
<A, T> void addValidatorFunction(@NotNull Class<A> annotationClass, @NotNull Function<A, Validator<T>> validatorFunction);

/**
* Adds an annotation that can than be used to validate config entries.
* Some annotations are registered by default (see {@link Validate})
*
* @param annotationClass the class of the annotation
* @param validator the {@link Validator}
* @param <A> the annotation
* @param <T> the type of the validator
* @throws IllegalArgumentException if the given class is not an annotation
*/
default <A, T> void addValidator(@NotNull Class<A> annotationClass, @NotNull Validator<T> validator) {
Objects.requireNonNull(validator);
this.addValidatorFunction(annotationClass, annotation -> validator);
Expand Down

0 comments on commit 09d4b70

Please sign in to comment.