@Override public Date getBarcodeDate() { return getCreationDate(); }
@Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append(getId()); sb.append(" : "); sb.append(getName()); sb.append(" : "); sb.append(getCreationDate()); sb.append(" : "); sb.append(getConcentration()); return sb.toString(); }
@CoverageIgnore @Override public int hashCode() { if (LibraryDilution.UNSAVED_ID != getId()) { return (int) getId(); } else { final int PRIME = 37; int hashcode = 1; if (getCreationDate() != null) hashcode = PRIME * hashcode + getCreationDate().hashCode(); if (getCreator() != null) hashcode = PRIME * hashcode + getCreator().hashCode(); if (getConcentration() != null) hashcode = PRIME * hashcode + getConcentration().hashCode(); return hashcode; } }
if (them.getCreationDate() != null) return false; } else if (!creationDate.equals(them.getCreationDate())) { return false;
private static DilutionDto asDto(@Nonnull LibraryDilution from, @Nonnull LibraryDto libraryDto, boolean includeBoxPositions) { DilutionDto dto = new DilutionDto(); dto.setId(from.getId()); dto.setName(from.getName()); dto.setDilutionUserName(from.getCreator().getFullName()); dto.setConcentration(from.getConcentration() == null ? null : from.getConcentration().toString()); dto.setConcentrationUnits(from.getConcentrationUnits()); dto.setVolume(from.getVolume() == null ? null : from.getVolume().toString()); dto.setVolumeUnits(from.getVolumeUnits()); dto.setNgUsed(from.getNgUsed() == null ? null : from.getNgUsed().toString()); dto.setVolumeUsed(from.getVolumeUsed() == null ? null : from.getVolumeUsed().toString()); if (from.getCreationDate() != null) { dto.setCreationDate(formatDate(from.getCreationDate())); } dto.setIdentificationBarcode(from.getIdentificationBarcode()); dto.setLocationLabel(BoxUtils.makeLocationLabel(from)); if (from.getTargetedSequencing() != null) { dto.setTargetedSequencingId(from.getTargetedSequencing().getId()); } dto.setLibrary(libraryDto); if (from.getBox() != null) { dto.setBox(asDto(from.getBox(), includeBoxPositions)); dto.setBoxPosition(from.getBoxPosition()); } dto.setDiscarded(from.isDiscarded()); return dto; }