Package com.alibaba.citrus.generictype

Examples of com.alibaba.citrus.generictype.TypeInfo.resolve()


        TypeInfo varT = iterableType.getTypeParameters().get(0);

        assertEquals(expectedType, varT.resolve(listAType, false));

        // includeBaseType==true, T => Object
        assertEquals(TypeInfo.OBJECT, varT.resolve(listAType));
        assertEquals(TypeInfo.OBJECT, varT.resolve(listAType, true));
    }
}

class MyClass<A extends Number> {
View Full Code Here


        assertEquals(expectedType, varT.resolve(listAType, false));

        // includeBaseType==true, T => Object
        assertEquals(TypeInfo.OBJECT, varT.resolve(listAType));
        assertEquals(TypeInfo.OBJECT, varT.resolve(listAType, true));
    }
}

class MyClass<A extends Number> {
    public List<A> listA;
View Full Code Here

        assertTrue(index < parentClass.getTypeParameters().length, "index out of bound");

        GenericDeclarationInfo context = factory.getGenericDeclaration(contextClass);
        TypeInfo param = factory.getType(parentClass.getTypeParameters()[index]);

        return param.resolve(context);
    }

    /** 取得{@link Map}的key类型。 */
    public static TypeInfo resolveMapKey(Class<?> mapClass) {
        return resolveMapKey(factory.getClassType(mapClass));
View Full Code Here

        assertTrue(index < parentClass.getTypeParameters().length, "index out of bound");

        GenericDeclarationInfo context = factory.getGenericDeclaration(contextClass);
        TypeInfo param = factory.getType(parentClass.getTypeParameters()[index]);

        return param.resolve(context);
    }

    /**
     * ȡ��{@link Map}��key���͡�
     */
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.