// o is either a map already (string->object) or an arbitrary object, // in which case its fields are converted into a map. static Map objectToMap_nonTransient(O o) { if (o == null) null; if (o instanceof Map) ret (Map) o; new HashMap map; for (Field field : nonStaticNonTransientFieldObjects_cachedArray(o)) { O value = fieldGet(field, o); if (value != null) map.put(field.getName(), value); } // TODO: Should we drop fieldValues key from map? if (o cast DynamicObject) putAll(map, o.fieldValues); ret map; }