use of groovy.lang.SpreadMapEvaluatingException in project groovy by apache.
the class InvokerHelper method spreadMap.
public static SpreadMap spreadMap(Object value) {
if (value instanceof Map) {
Object[] values = new Object[((Map) value).keySet().size() * 2];
int index = 0;
for (Object key : ((Map) value).keySet()) {
values[index++] = key;
values[index++] = ((Map) value).get(key);
}
return new SpreadMap(values);
}
throw new SpreadMapEvaluatingException("Cannot spread the map " + typeName(value) + ", value " + value);
}
Aggregations