Skip to content

Commit 1df0416

Browse files
committed
Fix: Added Float and AttributeLIsts to the type of Attributes
1 parent b76b57e commit 1df0416

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

src/main/java/de/vill/model/Attribute.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import java.util.Map;
55
import java.util.Objects;
66

7+
import javax.management.AttributeList;
8+
79
import de.vill.model.building.VariableReference;
810
import de.vill.model.constraint.Constraint;
911
import de.vill.util.Constants;
@@ -65,13 +67,17 @@ public String getName() {
6567
* @return Name of the attribute (never null)
6668
*/
6769
public String getType() {
68-
if (value instanceof Number) {
69-
return Constants.NUMBER;
70+
if (value instanceof Integer) {
71+
return Constants.INTEGER;
7072
} else if (value instanceof Boolean) {
7173
return Constants.BOOLEAN;
7274
} else if (value instanceof String) {
73-
return Constants.STRING;
74-
} else {
75+
return Constants.STRING;
76+
} else if (value instanceof AttributeList) {
77+
return Constants.ATTRIBUTE_LIST;
78+
} else if (value instanceof Float) {
79+
return Constants.FLOAT;
80+
}else {
7581
return Constants.UNDEF;
7682
}
7783
}

src/main/java/de/vill/util/Constants.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
public class Constants {
44
// Literal Types
5-
public static final String NUMBER = "number";
5+
public static final String INTEGER = "integer";
6+
public static final String FLOAT = "float";
7+
public static final String ATTRIBUTE_LIST = "attribute_list";
68
public static final String STRING = "string";
79
public static final String BOOLEAN = "boolean";
810
public static final String TRUE = "true";

0 commit comments

Comments
 (0)