类 GenericCodecInfo

java.lang.Object
cn.wjybxx.dsoncodec.GenericCodecInfo

public final class GenericCodecInfo extends Object
作者:
wjybxx date - 2024/10/11
  • 字段详细资料

    • typeInfo

      public final cn.wjybxx.base.TypeInfo typeInfo
    • codecType

      public final Class<? extends DsonCodec> codecType
    • factory

      public final Supplier<?> factory
  • 方法详细资料

    • create

      public static GenericCodecInfo create(cn.wjybxx.base.TypeInfo typeInfo, Class<? extends DsonCodec> codecType)
      参数:
      typeInfo - 泛型擦除后的类型信息
      codecType - 编解码器的类型
    • create

      public static GenericCodecInfo create(cn.wjybxx.base.TypeInfo typeInfo, Class<? extends DsonCodec> codecType, Class<?> implType)
      通过实现类创建一个Item
      参数:
      typeInfo - 泛型擦除后的类型信息
      codecType - 编解码器的类型
      implType - 创建的实例类型 -- 需包含无参构造函数,自动转factory
    • create

      public static GenericCodecInfo create(cn.wjybxx.base.TypeInfo typeInfo, Class<? extends DsonCodec> codecType, Supplier<?> factory)
      通过工厂创建一个item
      参数:
      typeInfo - 泛型擦除后的类型信息
      codecType - 编解码器的类型
      factory - 创建的实例类型 -- 需包含无参构造函数,自动转factory