m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java
index a122813..745550b 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java
@@ -185,9 +185,14 @@ public class ClientController {
switch (attributeObject.getAttributeType()) {
case "Boolean":
- attributeValue = attributeObject.getValueString().toLowerCase().equals("true") ?
- new ValueBoolean(true) :
- new ValueBoolean(false);
+ if (attributeObject.getValueString().toLowerCase().equals("true")) {
+ attributeValue = new ValueBoolean(true);
+ } else if (attributeObject.getValueString().toLowerCase().equals("false")) {
+ attributeValue = new ValueBoolean(false);
+ } else {
+ String errMsg = "Incorrect boolean value: " + attributeObject.getValueString();
+ throw new UnsupportedOperationException(errMsg);
+ }
break;
case "Double":
attributeValue = new ValueDouble(Double.parseDouble(attributeObject.getValueString()));