public void hydrate(RegionWidgetImpl widget, Region region) {
widget.setRegion(region);
}
public RegionWidgetImpl convert(RegionWidget sourceRegionWidget) {
RegionWidgetImpl regionWidget = sourceRegionWidget instanceof RegionWidgetImpl ? (RegionWidgetImpl) sourceRegionWidget : new RegionWidgetImpl();
//RegionWidgetIds MUST be a Long due to the mapping of ModuleID in Shindig.
regionWidget.setId(sourceRegionWidget.getId() == null ? generateLongId().toString() : sourceRegionWidget.getId());
regionWidget.setWidgetId(sourceRegionWidget.getWidgetId());
regionWidget.setRegion(null);
regionWidget.setPreferences(sourceRegionWidget.getPreferences());
updatePreferences(regionWidget);
updateProperties(sourceRegionWidget, regionWidget);
return regionWidget;
}