org.n3r.eql.convert.EqlDecodeConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eql Show documentation
Show all versions of eql Show documentation
a simple wrapper framework for jdbc to seperate sql and java code
package org.n3r.eql.convert;
import lombok.val;
import java.lang.annotation.Annotation;
/**
* @author bingoohuang [[email protected]] Created on 2017/2/9.
*/
public class EqlDecodeConverter implements EqlConverter {
@Override public Object convert(Annotation ann, Object src) {
if (src == null) return null;
val eqlDecode = (EqlDecode) ann;
val srcStr = String.valueOf(src);
val decodeValues = eqlDecode.value();
val toType = eqlDecode.toType();
return DecodeUtils.decode(srcStr, decodeValues, toType);
}
}