use of graphql.language.StringValue in project structr by structr.
the class QueryConfig method castValue.
private Object castValue(final SecurityContext securityContext, final Class type, final PropertyKey key, final Value value) throws FrameworkException {
if (value instanceof StringValue) {
return getStringValue(value, null);
}
if (value instanceof IntValue) {
return getIntegerValue(value, -1);
}
if (value instanceof BooleanValue) {
return getBooleanValue(value, false);
}
if (value instanceof ObjectValue && key != null) {
final Map<String, Object> parameters = new LinkedHashMap<>();
parameters.put(key.jsonName(), getMapValue(securityContext, type, value));
final PropertyMap propertyMap = PropertyMap.inputTypeToJavaType(securityContext, type, parameters);
// return converted result (should be replaced by NodeInterface)
return propertyMap.get(key);
}
return null;
}
Aggregations