@Override public ConnectionStatusSnapshotEntity clone() { final ConnectionStatusSnapshotEntity other = new ConnectionStatusSnapshotEntity(); other.setCanRead(this.getCanRead()); other.setConnectionStatusSnapshot(this.getConnectionStatusSnapshot().clone()); return other; } }
public ConnectionStatusSnapshotEntity createConnectionStatusSnapshotEntity(final ConnectionStatusSnapshotDTO status, final PermissionsDTO permissions) { final ConnectionStatusSnapshotEntity entity = new ConnectionStatusSnapshotEntity(); entity.setId(status.getId()); entity.setCanRead(permissions.getCanRead()); entity.setConnectionStatusSnapshot(status); // always set the status, as it's always allowed... just need to provide permission context for merging responses return entity; }
public static void merge(final ConnectionStatusSnapshotEntity target, ConnectionStatusSnapshotEntity toMerge) { if (target == null || toMerge == null) { return; } merge(target.getConnectionStatusSnapshot(), target.getCanRead(), toMerge.getConnectionStatusSnapshot(), toMerge.getCanRead()); }