
net.vvakame.util.jsonpullparser.builder.JsonCoderRouter Maven / Gradle / Ivy
The newest version!
package net.vvakame.util.jsonpullparser.builder;
/**
* Router for JsonModelCoder that routed by model.
* @author vvakame
* @param
*/
public abstract class JsonCoderRouter {
/**
* Resolve coder by model.
* @param obj
* @return custom coder, can't return null.
* @author vvakame
*/
public abstract JsonModelCoder resolve(T obj);
/**
* Call {@link #resolve(Object)} and checl not null.
* @param obj
* @return custom coder
* @author vvakame
*/
public JsonModelCoder doResolve(T obj) {
JsonModelCoder coder = resolve(obj);
if (coder == null) {
throw new NullPointerException("resolve method must return coder.");
}
return coder;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy