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

org.khasanof.executors.matcher.SimpleCallbacksMatcher Maven / Gradle / Ivy

There is a newer version: 1.2.2
Show newest version
package org.khasanof.executors.matcher;

import org.khasanof.annotation.methods.HandleCallback;
import org.khasanof.annotation.methods.HandleCallbacks;
import org.khasanof.config.ApplicationConstants;
import org.springframework.stereotype.Component;

import java.util.Arrays;

/**
 * @author Nurislom
 * @see org.khasanof.executors.matcher
 * @since 24.06.2023 0:57
 */
@Component
public class SimpleCallbacksMatcher extends GenericMatcher {

    private final GenericMatcher matcher;

    public SimpleCallbacksMatcher(GenericMatcher matcher) {
        super(ApplicationConstants.MATCHER_MAP);
        this.matcher = matcher;
    }

    @Override
    public boolean matcher(HandleCallbacks annotation, String value) {
        return Arrays.stream(annotation.values())
                .anyMatch(handleCallback -> matcher.matcher(handleCallback, value));
    }

    @Override
    public Class getType() {
        return HandleCallbacks.class;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy