Skip to content
Snippets Groups Projects
Commit 28b8e7de authored by Piotr Gawron's avatar Piotr Gawron
Browse files

msall refactor to provide the same results as before refactor

parent 7907cc2b
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
......@@ -141,7 +142,7 @@ public class OverlayRestImpl extends BaseRestImpl {
if (columns != null && !columns.trim().isEmpty()) {
columnSet = columns.split(",");
} else {
columnSet = new String[] { "modelId", "value", "color", "idObject" };
columnSet = new String[] { "modelId", "idObject", "value", "color", "uniqueId" };
}
List<Map<String, Object>> result = new ArrayList<>();
......@@ -378,7 +379,8 @@ public class OverlayRestImpl extends BaseRestImpl {
if (columns != null && !columns.trim().isEmpty()) {
columnSet = columns.split(",");
} else {
columnSet = new String[] { "modelId", "value", "color", "idObject", "description", "type", "geneVariations" };
columnSet = new String[] { "modelId", "idObject", "value", "color", "description", "type", "geneVariations",
"uniqueId" };
}
Map<String, Object> result = new TreeMap<>();
if (ElementIdentifierType.ALIAS.getJsName().equals(elementType)) {
......@@ -400,15 +402,16 @@ public class OverlayRestImpl extends BaseRestImpl {
private Map<String, Object> overlayContentToMap(Pair<? extends BioEntity, ColorSchema> bioEntityDataOverlay,
String[] columns) {
Map<String, Object> result = new TreeMap<>();
Map<String, Object> result = new LinkedHashMap<>();
BioEntity bioEntity = bioEntityDataOverlay.getLeft();
ColorSchema colorSchema = bioEntityDataOverlay.getRight();
for (String string : columns) {
String column = string.toLowerCase();
Object value = null;
if (column.equals("id") || column.equals("idobject")) {
value = bioEntity.getId();
} else if (column.equals("modelId")) {
if (column.equals("id") || column.equals("idobject") || column.equals("uniqueid")) {
//casting to string is only to provide the same results as before refactoring
value = bioEntity.getId()+"";
} else if (column.equals("modelid")) {
value = bioEntity.getModel().getId();
} else if (column.equals("value")) {
value = colorSchema.getValue();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment