本文整理汇总了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);
}