当前位置: 首页>>代码示例>>Java>>正文


Java ParameterizedType类代码示例

本文整理汇总了Java中com.bluelinelabs.logansquare.ParameterizedType的典型用法代码示例。如果您正苦于以下问题:Java ParameterizedType类的具体用法?Java ParameterizedType怎么用?Java ParameterizedType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ParameterizedType类属于com.bluelinelabs.logansquare包,在下文中一共展示了ParameterizedType类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: simpleGenericObject

import com.bluelinelabs.logansquare.ParameterizedType; //导入依赖的package包/类
@Test
public void simpleGenericObject() {
    String json = "{\"date\":\"2015-02-21T18:45:50.748+0000\",\"string\":\"testString\",\"test_double\":342.0,\"test_double_obj\":345.0,\"test_float\":898.0,\"test_float_obj\":382.0,\"test_int\":32,\"test_int_obj\":323,\"test_long\":932,\"test_long_obj\":3920,\"test_nested_generic\":{\"test_double\":0.0,\"test_float\":0.2,\"test_int\":10,\"test_long\":0},\"test_string\":\"anotherTestString\",\"test_t\":\"generic string!\"}";

    String reserialized = null;
    try {
        ParameterizedType<SimpleGenericModel<String>> parameterizedType = new ParameterizedType<SimpleGenericModel<String>>() { };
        SimpleGenericModel<String> simpleModel = LoganSquare.parse(json, parameterizedType);
        reserialized = LoganSquare.serialize(simpleModel, parameterizedType);
    } catch (Exception ignored) { }

    ASSERT.that(json.equals(reserialized)).isTrue();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:RoundTripTests.java

示例2: simpleGenericExtendsStringObject

import com.bluelinelabs.logansquare.ParameterizedType; //导入依赖的package包/类
@Test
public void simpleGenericExtendsStringObject() {
    String json = "{\"date\":\"2015-02-21T18:45:50.748+0000\",\"string\":\"testString\",\"test_double\":342.0,\"test_double_obj\":345.0,\"test_float\":898.0,\"test_float_obj\":382.0,\"test_int\":32,\"test_int_obj\":323,\"test_long\":932,\"test_long_obj\":3920,\"test_string\":\"anotherTestString\",\"test_t\":\"generic string!\"}";

    String reserialized = null;
    try {
        ParameterizedType<SimpleGenericModelWithExtends<String>> parameterizedType = new ParameterizedType<SimpleGenericModelWithExtends<String>>() { };
        SimpleGenericModelWithExtends<String> model = LoganSquare.parse(json, parameterizedType);
        reserialized = LoganSquare.serialize(model, parameterizedType);
    } catch (Exception ignored) { }

    ASSERT.that(json.equals(reserialized)).isTrue();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:RoundTripTests.java

示例3: simpleGenericGenericObject

import com.bluelinelabs.logansquare.ParameterizedType; //导入依赖的package包/类
@Test
public void simpleGenericGenericObject() {
    String json = "{\"date\":\"2015-02-21T18:45:50.748+0000\",\"string\":\"testString\",\"test_double\":342.0,\"test_double_obj\":345.0,\"test_float\":898.0,\"test_float_obj\":382.0,\"test_int\":32,\"test_int_obj\":323,\"test_long\":932,\"test_long_obj\":3920,\"test_string\":\"anotherTestString\",\"test_t\":{\"date\":\"2015-02-21T18:45:50.748+0000\",\"string\":\"testString\",\"test_double\":342.0,\"test_double_obj\":345.0,\"test_float\":898.0,\"test_float_obj\":382.0,\"test_int\":32,\"test_int_obj\":323,\"test_long\":932,\"test_long_obj\":3920,\"test_string\":\"anotherTestString\",\"test_t\":\"generic string!\"}}";

    String reserialized = null;
    try {
        ParameterizedType<SimpleGenericModel<SimpleGenericModel<String>>> parameterizedType = new ParameterizedType<SimpleGenericModel<SimpleGenericModel<String>>>() { };
        SimpleGenericModel<SimpleGenericModel<String>> simpleModel = LoganSquare.parse(json, parameterizedType);
        reserialized = LoganSquare.serialize(simpleModel, parameterizedType);
    } catch (Exception ignored) { }

    ASSERT.that(json.equals(reserialized)).isTrue();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:RoundTripTests.java

示例4: twoParamGenericModelObject

import com.bluelinelabs.logansquare.ParameterizedType; //导入依赖的package包/类
@Test
public void twoParamGenericModelObject() {
    String json = "{\"t_list\":[\"a\",\"b\"],\"test_k\":1,\"test_t\":\"hello\"}";

    String reserialized = null;
    try {
        ParameterizedType<TwoParamGenericModel<String, Integer>> parameterizedType = new ParameterizedType<TwoParamGenericModel<String, Integer>>() { };
        TwoParamGenericModel<String, Integer> model = LoganSquare.parse(json, parameterizedType);
        reserialized = LoganSquare.serialize(model, parameterizedType);
    } catch (Exception ignored) { }

    ASSERT.that(json.equals(reserialized)).isTrue();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:RoundTripTests.java

示例5: twoParamGenericWithStringModelObject

import com.bluelinelabs.logansquare.ParameterizedType; //导入依赖的package包/类
@Test
public void twoParamGenericWithStringModelObject() {
    String json = "{\"t_list\":[\"a\",\"b\"],\"test_k\":1,\"test_t\":\"hello\"}";

    String reserialized = null;
    try {
        ParameterizedType<TwoParamGenericWithStringModel<Integer>> parameterizedType = new ParameterizedType<TwoParamGenericWithStringModel<Integer>>() { };
        TwoParamGenericWithStringModel<Integer> model = LoganSquare.parse(json, parameterizedType);
        reserialized = LoganSquare.serialize(model, parameterizedType);
    } catch (Exception ignored) { }

    ASSERT.that(json.equals(reserialized)).isTrue();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:RoundTripTests.java

示例6:

import com.bluelinelabs.logansquare.ParameterizedType; //导入依赖的package包/类
public SimpleGenericModel$$JsonObjectMapper(ParameterizedType type, ParameterizedType TType, SimpleArrayMap<ParameterizedType, JsonMapper> partialMappers) {
  partialMappers.put(type, this);
  m84ClassJsonMapper = LoganSquare.mapperFor(TType, partialMappers);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:SimpleGenericModel$$JsonObjectMapper.java

示例7:

import com.bluelinelabs.logansquare.ParameterizedType; //导入依赖的package包/类
public SimpleGenericModelWithExtends$$JsonObjectMapper(ParameterizedType type, ParameterizedType TType, SimpleArrayMap<ParameterizedType, JsonMapper> partialMappers) {
  partialMappers.put(type, this);
  m84ClassJsonMapper = LoganSquare.mapperFor(TType, partialMappers);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:SimpleGenericModelWithExtends$$JsonObjectMapper.java

示例8:

import com.bluelinelabs.logansquare.ParameterizedType; //导入依赖的package包/类
public BaseModel$$JsonObjectMapper(ParameterizedType type, ParameterizedType TType, SimpleArrayMap<ParameterizedType, JsonMapper> partialMappers) {
    partialMappers.put(type, this);
    mClassJsonMapper = LoganSquare.mapperFor(TType, partialMappers);
}
 
开发者ID:xuehuayous,项目名称:Hannibai,代码行数:5,代码来源:BaseModel$$JsonObjectMapper.java

示例9: mapperFor

import com.bluelinelabs.logansquare.ParameterizedType; //导入依赖的package包/类
protected <T> JsonMapper<T> mapperFor(@NotNull ParameterizedType<T> type) {
    return LoganSquare.mapperFor(type);
}
 
开发者ID:mariotaku,项目名称:RestFu,代码行数:4,代码来源:LoganSquareConverterFactory.java


注:本文中的com.bluelinelabs.logansquare.ParameterizedType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。