class Item implements Serializable, Cacheable {

	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();
		}
		
		Summary fromSummary = from.getSummary();
		
		Summary newSummary;
		if (null == fromSummary) {
			newSummary = null;
		} else {
			newSummary = Summary.copyValues(from.getSummary(), toSummary);
		}
		
		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(newSummary);
		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;
	}

}