com.github.hekonsek.vertx.pipes.SimpleFunctionRegistry Maven / Gradle / Ivy
package com.github.hekonsek.vertx.pipes;
import java.util.LinkedHashMap;
import java.util.Map;
public class SimpleFunctionRegistry implements FunctionRegistry {
private final Map functions = new LinkedHashMap<>();
public void registerFunction(String functionName, Function function) {
if(function instanceof StartableFunction) {
((StartableFunction) function).start();
}
functions.put(functionName, function);
}
@Override public Function function(String functionName) {
return functions.get(functionName);
}
}