/** * Creates a full copy of another {@link GroupData}. * * @param other The other GroupData to copy. If not-null, must have groups and metrics. * @return A {@link CachingGroupData} copy of the GroupData or null if it was null. */ public static CachingGroupData copy(GroupData other) { return other != null ? new CachingGroupData(copy(other.groupFields), copy(other.metrics)) : null; }
/** * Creates an partial copy of itself. Only the metrics are copied, not the group. * * @return A copied {@link CachingGroupData}. */ public CachingGroupData partialCopy() { return new CachingGroupData(groupFields, copy(metrics)); }
@SuppressWarnings("unchecked") @Override public GroupDataSummary copy() { GroupDataSummary copy = new GroupDataSummary(); copy.initialized = initialized; copy.data = CachingGroupData.copy(data); return copy; }