use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class LasPoint8GpsTimeRgbNir method toMap.
@Override
public MapEx toMap() {
final MapEx map = super.toMap();
addToMap(map, "nir", this.nir);
return map;
}
use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class Node method getProperties.
@Override
public MapEx getProperties() {
if (this.graph == null) {
return MapEx.EMPTY;
} else {
final Map<Integer, MapEx> propertiesById = this.graph.getNodePropertiesById();
MapEx properties = propertiesById.get(this.id);
if (properties == null) {
properties = new LinkedHashMapEx();
propertiesById.put(this.id, properties);
}
return properties;
}
}
use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class FolderConnection method toMap.
@Override
public MapEx toMap() {
final MapEx map = super.toMap();
addTypeToMap(map, "folderConnection");
map.put("name", getName());
map.put("file", this.path.toAbsolutePath().toString());
return map;
}
use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class MapObjectFactory method toObject.
/**
* Convert the resource specified in the source parameter to an object. The properties parameter
* will override those specific properties.
*
* @param source
* @param properties
* @return
*/
static <V> V toObject(final Object source, final Map<String, ? extends Object> properties) {
final Resource resource = Resource.getResource(source);
final Resource oldResource = Resource.setBaseResource(resource.getParent());
try {
final MapEx resourceProperties = Json.toMap(resource);
resourceProperties.putAll(properties);
return toObject(resourceProperties);
} catch (final Throwable t) {
Logs.error(MapObjectFactoryRegistry.class, "Cannot load object from " + resource, t);
return null;
} finally {
Resource.setBaseResource(oldResource);
}
}
use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class MapObjectFactory method toObject.
/**
* Convert the resource specified in the source parameter to an object. The properties parameter
* will override those specific properties.
*
* @param source
* @param properties
* @return
*/
static <V> V toObject(final Object source, final Map<String, ? extends Object> properties, final BiConsumer<Resource, Throwable> errorHandler) {
final Resource resource = Resource.getResource(source);
final Resource oldResource = Resource.setBaseResource(resource.getParent());
try {
final MapEx resourceProperties = Json.toMap(resource);
resourceProperties.putAll(properties);
return toObject(resourceProperties);
} catch (final Throwable t) {
errorHandler.accept(resource, t);
return null;
} finally {
Resource.setBaseResource(oldResource);
}
}
Aggregations