小编hlf*_*lfv的帖子

为什么 com.fasterxml.jackson.core.type.TypeReference 实现 Comparable 接口?

为什么com.fasterxml.jackson.core.type.TypeReference实现Comparable 接口

我不明白实施它的意图。

public abstract class TypeReference<T> implements Comparable<TypeReference<T>> {
    protected final Type _type;
    
    protected TypeReference() {
        Type superClass = getClass().getGenericSuperclass();
        if (superClass instanceof Class<?>) { // sanity check, should never happen
            throw new IllegalArgumentException("Internal error: TypeReference constructed without actual type information");
        }
        /* 22-Dec-2008, tatu: Not sure if this case is safe -- I suspect
         *   it is possible to make it fail?
         *   But let's deal with specific
         *   case when we know an …
Run Code Online (Sandbox Code Playgroud)

java comparable jackson

3
推荐指数
1
解决办法
1446
查看次数

标签 统计

comparable ×1

jackson ×1

java ×1