@Override public ProcessorStatusSnapshotEntity clone() { final ProcessorStatusSnapshotEntity other = new ProcessorStatusSnapshotEntity(); other.setCanRead(this.getCanRead()); other.setProcessorStatusSnapshot(this.getProcessorStatusSnapshot().clone()); return other; } }
public ProcessorStatusSnapshotEntity createProcessorStatusSnapshotEntity(final ProcessorStatusSnapshotDTO status, final PermissionsDTO permissions) { final ProcessorStatusSnapshotEntity entity = new ProcessorStatusSnapshotEntity(); entity.setId(status.getId()); entity.setCanRead(permissions.getCanRead()); entity.setProcessorStatusSnapshot(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 ProcessorStatusSnapshotEntity target, ProcessorStatusSnapshotEntity toMerge) { if (target == null || toMerge == null) { return; } merge(target.getProcessorStatusSnapshot(), target.getCanRead(), toMerge.getProcessorStatusSnapshot(), toMerge.getCanRead()); }