use of gov.usgs.cida.coastalhazards.model.summary.Summary in project coastal-hazards by USGS-CIDA.
the class Item method copyValues.
/**
* I'm creating a new item rather than modifying references (hence final)
*
* @param from item to copy values from
* @param to item to retain ids for
* @return new Item that is fully hydrated
*/
public static Item copyValues(final Item from, final Item to) {
Item item = new Item();
if (to != null && to.getItemType() != from.getItemType()) {
throw new UnsupportedOperationException("Cannot change item type");
}
String id = from.getId();
Bbox toBbox = null;
Summary toSummary = null;
if (to != null) {
id = to.getId();
toBbox = to.getBbox();
toSummary = to.getSummary();
}
item.setId(id);
item.setItemType(from.getItemType());
item.setType(from.getType());
item.setName(from.getName());
item.setAttr(from.getAttr());
item.setBbox(Bbox.copyValues(from.getBbox(), toBbox));
item.setSummary(Summary.copyValues(from.getSummary(), toSummary));
item.setRibbonable(from.isRibbonable());
item.setShowChildren(from.isShowChildren());
item.setEnabled(from.isEnabled());
item.setServices(from.getServices());
item.setChildren(from.getChildren());
item.setDisplayedChildren(from.getDisplayedChildren());
item.setActiveStorm(from.isActiveStorm());
item.setFeatured(from.isFeatured());
return item;
}
Aggregations