本文整理匯總了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例9: mapperFor
import com.bluelinelabs.logansquare.ParameterizedType; //導入依賴的package包/類
protected <T> JsonMapper<T> mapperFor(@NotNull ParameterizedType<T> type) {
return LoganSquare.mapperFor(type);
}