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

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

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

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

import java.util.Map;

/**
 * @author Nurislom
 * @see org.khasanof.executors.matcher
 * @since 25.06.2023 22:50
 */
@Component
public class SimpleMessageMatcher extends GenericMatcher {

    public SimpleMessageMatcher() {
        super(ApplicationConstants.MATCHER_MAP);
    }

    @Override
    public boolean matcher(HandleMessage handleMessage, String value) {
        return matchFunctions.get(Map.entry(handleMessage.scope(), getScopeType(value, handleMessage.scope())))
                .apply(handleMessage.value(), value);
    }

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

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy