public SequencerPartitionContainer createContainer() { return new SequencerPartitionContainerImpl(); }
@Override public Date getBarcodeDate() { return getCreationTime(); }
@Override public int hashCode() { if (getId() != SequencerPartitionContainerImpl.UNSAVED_ID) { return (int) getId(); } else { int hashcode = -1; if (getIdentificationBarcode() != null) hashcode = 37 * hashcode + getIdentificationBarcode().hashCode(); return hashcode; } }
@Override public String getDeleteDescription() { return getIdentificationBarcode() + " (" + getModel().getAlias() + ")"; }
@Override public String getBarcodeSizeInfo() { return String.format("%s: %d", getModel().getPlatformType().getPluralPartitionName(), getPartitions().size()); }
@Override public boolean isSaved() { return getId() != UNSAVED_ID; }
@Override public String getBarcodeExtraInfo() { return getModel().getAlias(); }
@Override public String getAlias() { return getIdentificationBarcode(); }
@Override public SecurityProfile getDeletionSecurityProfile() { return getSecurityProfile(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; OxfordNanoporeContainer other = (OxfordNanoporeContainer) obj; if (poreVersion == null) { if (other.poreVersion != null) return false; } else if (!poreVersion.equals(other.poreVersion)) return false; if (receivedDate == null) { if (other.receivedDate != null) return false; } else if (!receivedDate.equals(other.receivedDate)) return false; if (returnedDate == null) { if (other.returnedDate != null) return false; } else if (!returnedDate.equals(other.returnedDate)) return false; return true; }
@Override public void setPartitionLimit(int partitionLimit) { getPartitions().clear(); for (int i = 0; i < partitionLimit; i++) { PartitionImpl partition = new PartitionImpl(); partition.setSequencerPartitionContainer(this); partition.setPartitionNumber(i + 1); getPartitions().add(partition); } }
@Override public Run getLastRun() { return getRunPositions().stream().map(RunPosition::getRun).filter(r -> r.getStartDate() != null) .max((a, b) -> a.getStartDate().compareTo(b.getStartDate())) .orElse(null); }
@Override public String getLabelText() { return getIdentificationBarcode() + " (" + getModel().getAlias() + ")"; }
@Override public String getDeleteType() { return getModel().getPlatformType().getContainerName(); }
SequencerPartitionContainer newContainer = new SequencerPartitionContainerImpl(user); newContainer.setModel(containerModel); newContainer.setCreator(user);
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getId()); sb.append(" : "); sb.append(getIdentificationBarcode()); return sb.toString(); }
@Override public void execute(WorkflowExecutor workflowExecutor) throws IOException { if (!isComplete()) throw new IllegalStateException("Workflow is not complete"); SequencerPartitionContainer spc; if (containerStep.isExistingContainer()) { spc = containerStep.getContainer(); } else { spc = new SequencerPartitionContainerImpl(); SequencingContainerModel model = containerModelStep.getModel(); spc.setModel(model); spc.setIdentificationBarcode(containerStep.getBarcode()); spc.setPartitionLimit(model.getPartitionCount()); } for (int i = 0; i < partitionSteps.size(); ++i) { spc.getPartitionAt(i + 1).setPool(partitionSteps.get(i).getPool()); } workflowExecutor.save(spc); }
@Override public boolean equals(Object obj) { if (obj == null) return false; if (obj == this) return true; if (!(obj instanceof SequencerPartitionContainer)) return false; SequencerPartitionContainer them = (SequencerPartitionContainer) obj; // If not saved, then compare resolved actual objects. Otherwise just compare IDs. if (getId() == SequencerPartitionContainerImpl.UNSAVED_ID || them.getId() == SequencerPartitionContainerImpl.UNSAVED_ID) { return getIdentificationBarcode().equals(them.getIdentificationBarcode()); } else { return getId() == them.getId(); } }
case Container: ContainerQC newContainerQc = new ContainerQC(); SequencerPartitionContainer ownerContainer = new SequencerPartitionContainerImpl(); ownerContainer.setId(dto.getEntityId()); newContainerQc.setContainer(ownerContainer);