本文整理了Java中io.restassured.path.json.JsonPath.jsonStringToObject()
方法的一些代码示例,展示了JsonPath.jsonStringToObject()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonPath.jsonStringToObject()
方法的具体详情如下:
包路径:io.restassured.path.json.JsonPath
类名称:JsonPath
方法名:jsonStringToObject
暂无
代码示例来源:origin: rest-assured/rest-assured
/**
* Get the result of an Object path expression as a list.
*
* @param path The Object path.
* @param genericType The generic list type
* @param <T> The type
* @return The object matching the Object path. A {@link java.lang.ClassCastException} will be thrown if the object
* cannot be casted to the expected type.
*/
public <T> List<T> getList(String path, Class<T> genericType) {
if (genericType == null) {
throw new IllegalArgumentException("Generic type cannot be null");
}
final List<T> original = get(path);
final List<T> newList = new LinkedList<T>();
if (original != null) {
for (T t : original) {
T e;
if (t instanceof Map && !genericType.isAssignableFrom(Map.class)) {
// TODO Avoid double parsing
String str = objectToString(t);
e = jsonStringToObject(str, genericType);
} else {
e = ObjectConverter.convertObjectTo(t, genericType);
}
newList.add(e);
}
}
return Collections.unmodifiableList(newList);
}
代码示例来源:origin: rest-assured/rest-assured
/**
* Get the result of an Object path expression as a list.
*
* @param path The Object path.
* @param genericType The generic list type
* @param <T> The type
* @return The object matching the Object path. A {@link java.lang.ClassCastException} will be thrown if the object
* cannot be casted to the expected type.
*/
public <T> List<T> getList(String path, Class<T> genericType) {
if (genericType == null) {
throw new IllegalArgumentException("Generic type cannot be null");
}
final List<T> original = get(path);
final List<T> newList = new LinkedList<T>();
if (original != null) {
for (T t : original) {
T e;
if (t instanceof Map && !genericType.isAssignableFrom(Map.class)) {
// TODO Avoid double parsing
String str = objectToString(t);
e = jsonStringToObject(str, genericType);
} else {
e = ObjectConverter.convertObjectTo(t, genericType);
}
newList.add(e);
}
}
return Collections.unmodifiableList(newList);
}
代码示例来源:origin: rest-assured/rest-assured
return jsonStringToObject((String) object, objectType);
代码示例来源:origin: rest-assured/rest-assured
return jsonStringToObject((String) object, objectType);
代码示例来源:origin: io.rest-assured/json-path
/**
* Get the result of an Object path expression as a list.
*
* @param path The Object path.
* @param genericType The generic list type
* @param <T> The type
* @return The object matching the Object path. A {@link java.lang.ClassCastException} will be thrown if the object
* cannot be casted to the expected type.
*/
public <T> List<T> getList(String path, Class<T> genericType) {
if (genericType == null) {
throw new IllegalArgumentException("Generic type cannot be null");
}
final List<T> original = get(path);
final List<T> newList = new LinkedList<T>();
if (original != null) {
for (T t : original) {
T e;
if (t instanceof Map && !genericType.isAssignableFrom(Map.class)) {
// TODO Avoid double parsing
String str = objectToString(t);
e = jsonStringToObject(str, genericType);
} else {
e = ObjectConverter.convertObjectTo(t, genericType);
}
newList.add(e);
}
}
return Collections.unmodifiableList(newList);
}
代码示例来源:origin: io.rest-assured/json-path
return jsonStringToObject((String) object, objectType);
内容来源于网络,如有侵权,请联系作者删除!