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

org.khasanof.factories.method.ExceptionMethodCheckConditionFactoryImpl Maven / Gradle / Ivy

The newest version!
package org.khasanof.factories.method;

import org.khasanof.annotation.exception.HandleException;
import org.khasanof.models.condition.MethodGenericCondition;
import org.khasanof.utils.AnnotationUtils;
import org.springframework.stereotype.Component;

import java.lang.annotation.Annotation;
import java.util.Set;

/**
 * @author Nurislom
 * @see org.khasanof.factories.method
 * @since 12/27/2023 10:14 PM
 */
@Component
public class ExceptionMethodCheckConditionFactoryImpl extends ExceptionMethodCheckConditionFactory {

    private final Class annotation = HandleException.class;

    @Override
    public Set create() {
        return Set.of(firstCondition());
    }

    private MethodGenericCondition firstCondition() {
        return method -> AnnotationUtils.hasAnnotation(method, annotation, false);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy