org.polkadot.direct.ISection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of polkadot-java Show documentation
Show all versions of polkadot-java Show documentation
Java Polkadot API, this is a clone of https://github.com/polkadot-java/api
The newest version!
package org.polkadot.direct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
public abstract class ISection {
private static final Logger logger = LoggerFactory.getLogger(ISection.class);
protected Map functions = new HashMap<>();
public F function(String function) {
return functions.get(function);
}
public boolean addFunction(String name, F function) {
boolean result = true;
if (this.functions.containsKey(name)) {
logger.error(" dup function name {}, {}, {}",
name, this.functions.get(name), function);
result = false;
}
this.functions.put(name, function);
return result;
}
public Set functionNames() {
return this.functions.keySet();
}
}