當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。