com.jn.agileway.codec.AbstractCodec Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of agileway-codec Show documentation
Show all versions of agileway-codec Show documentation
Provide an unified codec API for hession, kryo, protostuff, fst, fes, xson, cbor, jackson, json, etc....
package com.jn.agileway.codec;
import com.jn.langx.util.reflect.Reflects;
public abstract class AbstractCodec implements Codec {
private Class targetType;
@Override
public boolean canSerialize(Class type) {
if (targetType == null) {
return true;
}
return Reflects.isSubClassOrEquals(type, targetType);
}
public void setTargetType(Class targetType) {
this.targetType = targetType;
}
@Override
public Class getTargetType() {
return targetType;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy