All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jn.agileway.codec.AbstractCodec Maven / Gradle / Ivy

Go to download

Provide an unified codec API for hession, kryo, protostuff, fst, fes, xson, cbor, jackson, json, etc....

There is a newer version: 3.1.12
Show newest version
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