@Override public DataSource clone() throws CloneNotSupportedException { DataSource dataSource = (DataSource) super.clone(); dataSource.setId(null); dataSource.dataPoints = new HashSet<DataPoint>(); for (DataPoint dataPoint : this.dataPoints) { DataPoint dp = dataPoint.clone(); dp.setDataSource(this); dataSource.dataPoints.add(dp); } return dataSource; }
public void copy(DataSource dataSource) { this.name = dataSource.getName(); this.collectionInterval = dataSource.getCollectionInterval(); }