Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
core
Commits
28b8e7de
Commit
28b8e7de
authored
6 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rest-api/src/main/java/lcsb/mapviewer/api/projects/overlays/OverlayRestImpl.java
+9
-6
9 additions, 6 deletions
...lcsb/mapviewer/api/projects/overlays/OverlayRestImpl.java
with
9 additions
and
6 deletions
rest-api/src/main/java/lcsb/mapviewer/api/projects/overlays/OverlayRestImpl.java
+
9
−
6
View file @
28b8e7de
...
...
@@ -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
Tree
Map
<>();
Map
<
String
,
Object
>
result
=
new
LinkedHash
Map
<>();
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
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment