io.datakernel.codec.registry.CodecFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of datakernel-codec Show documentation
Show all versions of datakernel-codec Show documentation
Tools for encoding/decoding of primitives and objects.
package io.datakernel.codec.registry;
import io.datakernel.codec.StructuredCodec;
import io.datakernel.common.reflection.TypeT;
import java.lang.reflect.Type;
/**
* This is an interface for something that can create or retrieve a codec for a given type.
*/
public interface CodecFactory {
default StructuredCodec get(Class type) {
return get((Type) type);
}
default StructuredCodec get(TypeT type) {
return get(type.getType());
}
StructuredCodec get(Type type);
}