Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Commit

Permalink
In FIODataPoint, fields that are Strings are enclosed by double quotes.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Ervideira committed Dec 29, 2016
1 parent f24a576 commit 020b8af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@
<artifactId>minimal-json</artifactId>
<version>0.9.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

import com.eclipsesource.json.JsonObject;

import static org.apache.commons.lang3.StringUtils.strip;

public class FIODataPoint {

HashMap<String, Object> datapoint;
Expand All @@ -36,7 +38,7 @@ public FIODataPoint(JsonObject dp){
*/
void update(JsonObject dp){
for(int i = 0; i < dp.names().size(); i++){
datapoint.put(dp.names().get(i), dp.get(dp.names().get(i)));
datapoint.put(dp.names().get(i), dp.get(dp.names().get(i)));
}
}

Expand Down Expand Up @@ -121,7 +123,7 @@ public String getByKey(String key){
}
else
out = String.valueOf( datapoint.get(key) );
return out;
return strip(out, "\"");
}

/**
Expand Down Expand Up @@ -742,7 +744,7 @@ private Double asDouble(Object obj){
}

private String asString(Object obj){
return String.valueOf(obj);
return strip((String.valueOf(obj)), "\"");
}

}//public class - end
Expand Down

0 comments on commit 020b8af

Please sign in to comment.