diff --git a/src/main/java/uk/ac/ebi/eva/evaseqcol/service/SeqColService.java b/src/main/java/uk/ac/ebi/eva/evaseqcol/service/SeqColService.java index 3c81f27..3066beb 100644 --- a/src/main/java/uk/ac/ebi/eva/evaseqcol/service/SeqColService.java +++ b/src/main/java/uk/ac/ebi/eva/evaseqcol/service/SeqColService.java @@ -402,9 +402,9 @@ public String calculateSeqColLevelOneMapDigest(Map seqColLevelOn private String convertSeqColLevelTwoAttributeValuesToString(List seqColL2Attribute, SeqColExtendedDataEntity.AttributeType type) { switch (type) { case lengths: // List type - return JSONIntegerListExtData.toString((List) seqColL2Attribute); + return new JSONIntegerListExtData((List) seqColL2Attribute).toString(); default: // List types - return JSONStringListExtData.toString((List) seqColL2Attribute); + return new JSONStringListExtData((List) seqColL2Attribute).toString(); } } diff --git a/src/main/java/uk/ac/ebi/eva/evaseqcol/utils/JSONIntegerListExtData.java b/src/main/java/uk/ac/ebi/eva/evaseqcol/utils/JSONIntegerListExtData.java index 7c019b8..09abf2a 100644 --- a/src/main/java/uk/ac/ebi/eva/evaseqcol/utils/JSONIntegerListExtData.java +++ b/src/main/java/uk/ac/ebi/eva/evaseqcol/utils/JSONIntegerListExtData.java @@ -13,13 +13,6 @@ public JSONIntegerListExtData(List object) { super(object); } - /** - * The same as the Overridden toString method - * // TODO: we can get rid of this method for List types*/ - public static String toString(List object) { - return object.toString(); - } - @Override public String toString() { return this.object.toString(); diff --git a/src/main/java/uk/ac/ebi/eva/evaseqcol/utils/JSONStringListExtData.java b/src/main/java/uk/ac/ebi/eva/evaseqcol/utils/JSONStringListExtData.java index 0b1e28d..4ec1066 100644 --- a/src/main/java/uk/ac/ebi/eva/evaseqcol/utils/JSONStringListExtData.java +++ b/src/main/java/uk/ac/ebi/eva/evaseqcol/utils/JSONStringListExtData.java @@ -13,29 +13,6 @@ public JSONStringListExtData(List object) { super(object); } - /** - * The same as the Overridden toString method - * Used to avoid code duplication in different classes - * // TODO: We can find a better way to avoid code duplication*/ - public static String toString(List object) { - StringBuilder objectStr = new StringBuilder(); - int arraySize = ((List) object).size(); - // Include quotes. Eg: ["aaa", "bbb", "ccc"]. - objectStr.append("["); - for (int i=0; i) object).get(i)); - objectStr.append("\""); - objectStr.append(","); - } - objectStr.append("\""); - objectStr.append(((List) object).get(arraySize-1)); - objectStr.append("\""); - objectStr.append("]"); - - return objectStr.toString(); - } - @Override public String toString() { StringBuilder objectStr = new StringBuilder();