com.maxleap.code.impl.AbstractDefiner Maven / Gradle / Ivy
package com.maxleap.code.impl;
import com.maxleap.code.*;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
/**
* Created by stream.
*/
abstract class AbstractDefiner implements Definer {
protected Map> handlers;
//what kind of action.
protected RequestCategory category;
protected AbstractDefiner() {
this.handlers = new ConcurrentHashMap>();
}
@Override
public MLHandler getHandler(String name) {
return (MLHandler) handlers.get(name);
}
@Override
public RequestCategory getCategory() {
return category;
}
@Override
public void define(String name, MLHandler extends Request, ? extends Response> handler) {
handlers.put(name, handler);
}
@Override
public Set getHandlerNames() {
return handlers.keySet();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy