类的使用
cn.wjybxx.dsoncodec.DsonCodecConfig
使用DsonCodecConfig的程序包
-
cn.wjybxx.dsoncodec中DsonCodecConfig的使用
修饰符和类型字段说明final DsonCodecConfigDsonConverterBuilder.codecConfigstatic final DsonCodecConfigDsonCodecConfig.DEFAULT全局默认配置修饰符和类型方法说明DsonCodecConfig.addCaster(DsonCodecCaster caster) 添加类型转换器DsonCodecConfig.addCasters(Collection<? extends DsonCodecCaster> casters) 配置编解码器配置编解码器<T> DsonCodecConfig配置编解码器 适用超类Codec的默认解码实例可赋值给当前类型的情况,eg:IntList => IntCollectionCodec。配置编解码器DsonCodecConfig.addCodecs(Collection<? extends DsonCodec<?>> codecs) 配置编解码器DsonCodecConfig.addDecoder(cn.wjybxx.base.TypeInfo typeInfo, DsonCodec<?> codec) 配置解码器 -- 适用已构造泛型<T> DsonCodecConfigDsonCodecConfig.addDecoder(Class<T> clazz, DsonCodec<? extends T> codec) 配置解码器DsonCodecConfig.addEncoder(cn.wjybxx.base.TypeInfo typeInfo, DsonCodec<?> codec) 配置编码器 -- 适用已构造泛型<T> DsonCodecConfigDsonCodecConfig.addEncoder(Class<T> clazz, DsonCodec<? super T> codec) 配置编码器DsonCodecConfig.addGenericCodec(cn.wjybxx.base.TypeInfo genericType, Class<? extends DsonCodec> codecType) DsonCodecConfig.addGenericCodec(cn.wjybxx.base.TypeInfo genericType, Class<? extends DsonCodec> codecType, Class<?> implType) DsonCodecConfig.addGenericCodec(cn.wjybxx.base.TypeInfo genericType, Class<? extends DsonCodec> codecType, Supplier<?> factory) DsonCodecConfig.addGenericCodec(GenericCodecInfo genericCodecInfo) 增加一个codec配置DsonCodecConfig.addGenericDecoder(cn.wjybxx.base.TypeInfo genericType, Class<? extends DsonCodec> codecType) DsonCodecConfig.addGenericDecoder(cn.wjybxx.base.TypeInfo genericType, Class<? extends DsonCodec> codecType, Class<?> implType) DsonCodecConfig.addGenericDecoder(cn.wjybxx.base.TypeInfo genericType, Class<? extends DsonCodec> codecType, Supplier<?> factory) DsonCodecConfig.addGenericDecoder(GenericCodecInfo genericCodecInfo) 添加解码器DsonCodecConfig.addGenericEncoder(cn.wjybxx.base.TypeInfo genericType, Class<? extends DsonCodec> codecType) DsonCodecConfig.addGenericEncoder(cn.wjybxx.base.TypeInfo genericType, Class<? extends DsonCodec> codecType, Class<?> implType) DsonCodecConfig.addGenericEncoder(cn.wjybxx.base.TypeInfo genericType, Class<? extends DsonCodec> codecType, Supplier<?> factory) DsonCodecConfig.addGenericEncoder(GenericCodecInfo genericCodecInfo) 添加编码器DsonCodecConfig.addGenericHelper(GenericHelper genericHelper) 添加泛型工具类DsonCodecConfig.addGenericHelpers(Collection<? extends GenericHelper> genericHelpers) 添加泛型工具类<T> DsonCodecConfigDsonCodecConfig.addOptimizedType(Class<T> encoderType, Class<? super T> declaredType) 添加可优化编码类型(无需写入类型信息的情况)<T> DsonCodecConfigDsonCodecConfig.addOptimizedType(Class<T> encoderType, Class<? super T> declaredType, boolean val) 添加可优化编码类型(无需写入类型信息的情况) 泛型类请配置泛型原型类static DsonCodecConfigDsonCodecConfig.fromCodecs(DsonCodec<?>... codecs) 根据codecs创建一个Config -- 返回的实例不可变static DsonCodecConfigDsonCodecConfig.fromCodecs(Collection<? extends DsonCodec<?>> codecs) 根据codecs创建一个Config -- 返回的实例不可变static DsonCodecConfigDsonCodecConfig.fromConfigs(Collection<? extends DsonCodecConfig> configs) 合并多个Config为单个Config -- 返回的实例不可变DsonCodecConfig.mergeFrom(DsonCodecConfig other) 合并配置static DsonCodecConfigDsonCodecConfig.newDefaultRegistry()创建一个默认配置DsonCodecConfig.toImmutable()转换为不可变实例参数类型为DsonCodecConfig的cn.wjybxx.dsoncodec中的方法修饰符和类型方法说明DsonConverterBuilder.addCodecConfig(DsonCodecConfig codecConfig) DsonCodecConfig.mergeFrom(DsonCodecConfig other) 合并配置类型变量类型为DsonCodecConfig的cn.wjybxx.dsoncodec中的方法参数修饰符和类型方法说明DsonConverterBuilder.addCodecConfigs(Collection<DsonCodecConfig> codecConfigs) static DsonCodecConfigDsonCodecConfig.fromConfigs(Collection<? extends DsonCodecConfig> configs) 合并多个Config为单个Config -- 返回的实例不可变参数类型为DsonCodecConfig的cn.wjybxx.dsoncodec中的构造器