From 5d4f47cb6cfdebcc3e358858ac0f6355e0abcfb5 Mon Sep 17 00:00:00 2001 From: jnnfr Date: Mon, 24 Jan 2022 16:23:46 +0100 Subject: [PATCH] Add display name to status (#282) * Add displayName for sample status, add deprecated annotation --- CHANGELOG.rst | 2 + .../life/qbic/datamodel/samples/Status.groovy | 61 +++++++++++++++---- 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 838e88812..3949d9a53 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,6 +9,8 @@ This project adheres to `Semantic Versioning `_. **Added** +* Add displayName to ``life.qbic.datamodel.samples.Status`` (#282) + **Fixed** **Dependencies** diff --git a/src/main/groovy/life/qbic/datamodel/samples/Status.groovy b/src/main/groovy/life/qbic/datamodel/samples/Status.groovy index e990ae810..d8f9bc754 100644 --- a/src/main/groovy/life/qbic/datamodel/samples/Status.groovy +++ b/src/main/groovy/life/qbic/datamodel/samples/Status.groovy @@ -4,21 +4,56 @@ package life.qbic.datamodel.samples; * The status of an sample in the context of sample-tracking */ public enum Status { - SAMPLE_QC_FAIL, - SAMPLE_QC_PASS, - SAMPLE_RECEIVED, - LIBRARY_PREP_FINISHED, - SEQUENCING, - SEQUENCING_COMPLETE, - METADATA_REGISTERED, - WAITING, - PROCESSING, - FAILED_QC, - PROCESSED, - DATA_AVAILABLE, + SAMPLE_QC_FAIL ("Sample QC Fail"), + SAMPLE_QC_PASS ("Sample QC Pass"), + SAMPLE_RECEIVED ("Sample Received"), + LIBRARY_PREP_FINISHED ("Library Prep Finished"), + /** + * @deprecated this is deprecated since 2.16.0 please use {@link #SEQUENCING_COMPLETE} instead + */ + @Deprecated + SEQUENCING ("Sequencing"), + SEQUENCING_COMPLETE ("Sequencing Complete"), + METADATA_REGISTERED ("Metadata Registered"), + /** + * @deprecated this is deprecated since 2.16.0 + */ + @Deprecated + WAITING ("Waiting"), + /** + * @deprecated this is deprecated since 2.16.0 + */ + @Deprecated + PROCESSING ("Processing"), + /** + * @deprecated this is deprecated since 2.16.0 please use {@link #SAMPLE_QC_FAIL} instead + */ + @Deprecated + FAILED_QC ("Failed QC"), + /** + * @deprecated this is deprecated since 2.16.0 + */ + @Deprecated + PROCESSED ("Processed"), + DATA_AVAILABLE ("Data Available"), /** * @deprecated this is deprecated since 2.4.0 please use {@link #DATA_AVAILABLE} instead */ @Deprecated - DATA_AT_QBIC + DATA_AT_QBIC ("Data at QBiC") + + private final displayName + + private Status(String displayName){ + this.displayName = displayName + } + + /** + * Returns to the enum item display name + * @return + */ + String getDisplayName() { + return this.displayName + } + }