public Object copyTo(ObjectLocator locator, Object target, CopyStrategy strategy) { final Object draftCopy = ((target == null) ? createNewInstance() : target); super.copyTo(locator, draftCopy, strategy); if (draftCopy instanceof CompositeSurfaceType) { final CompositeSurfaceType copy = ((CompositeSurfaceType) draftCopy); if (this.isSetSurfaceMember()) { List<SurfacePropertyType> sourceSurfaceMember; sourceSurfaceMember = this.getSurfaceMember(); @SuppressWarnings("unchecked") List<SurfacePropertyType> copySurfaceMember = ((List<SurfacePropertyType>) strategy.copy( LocatorUtils.property(locator, "surfaceMember", sourceSurfaceMember), sourceSurfaceMember)); copy.unsetSurfaceMember(); List<SurfacePropertyType> uniqueSurfaceMemberl = copy.getSurfaceMember(); uniqueSurfaceMemberl.addAll(copySurfaceMember); } else { copy.unsetSurfaceMember(); } if (this.isSetAggregationType()) { AggregationType sourceAggregationType; sourceAggregationType = this.getAggregationType(); AggregationType copyAggregationType = ((AggregationType) strategy.copy( LocatorUtils.property(locator, "aggregationType", sourceAggregationType), sourceAggregationType)); copy.setAggregationType(copyAggregationType); } else { copy.aggregationType = null; } } return draftCopy; }
public void mergeFrom( ObjectLocator leftLocator, ObjectLocator rightLocator, Object left, Object right, MergeStrategy strategy) { super.mergeFrom(leftLocator, rightLocator, left, right, strategy); if (right instanceof CompositeSurfaceType) { final CompositeSurfaceType target = this; final CompositeSurfaceType leftObject = ((CompositeSurfaceType) left); final CompositeSurfaceType rightObject = ((CompositeSurfaceType) right); { List<SurfacePropertyType> lhsSurfaceMember; lhsSurfaceMember = leftObject.getSurfaceMember(); List<SurfacePropertyType> rhsSurfaceMember; rhsSurfaceMember = rightObject.getSurfaceMember(); target.unsetSurfaceMember(); List<SurfacePropertyType> uniqueSurfaceMemberl = target.getSurfaceMember(); uniqueSurfaceMemberl.addAll( ((List<SurfacePropertyType>) strategy.merge( LocatorUtils.property(leftLocator, "surfaceMember", lhsSurfaceMember), LocatorUtils.property(rightLocator, "surfaceMember", rhsSurfaceMember), lhsSurfaceMember, rhsSurfaceMember))); } { AggregationType lhsAggregationType; lhsAggregationType = leftObject.getAggregationType(); AggregationType rhsAggregationType; rhsAggregationType = rightObject.getAggregationType(); target.setAggregationType( ((AggregationType) strategy.merge( LocatorUtils.property(leftLocator, "aggregationType", lhsAggregationType), LocatorUtils.property(rightLocator, "aggregationType", rhsAggregationType), lhsAggregationType, rhsAggregationType))); } } }