Skip to content

Commit abac469

Browse files
author
Aaron
committed
MainNode doesn't have to be a child of the DSLink node.
1 parent 6840fce commit abac469

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ subprojects {
55
apply plugin: 'maven'
66

77
group 'org.iot-dsa'
8-
version '0.50.0'
8+
version '0.51.0'
99

1010
sourceCompatibility = 1.8
1111
targetCompatibility = 1.8

dslink-v2/src/main/java/org/iot/dsa/dslink/DSMainNode.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
public class DSMainNode extends DSNode {
1212

1313
/**
14-
* The parent link or null.
14+
* The ancestral DSLink, or null.
1515
*/
1616
public DSLink getLink() {
17-
return (DSLink) getParent();
17+
return (DSLink) getAncestor(DSLink.class);
1818
}
1919

2020
/**
@@ -31,14 +31,4 @@ public boolean isResponder() {
3131
return true;
3232
}
3333

34-
/**
35-
* The parent must be a DSLink instance.
36-
*/
37-
public void validateParent(DSNode node) {
38-
if (node instanceof DSLink) {
39-
return;
40-
}
41-
throw new IllegalArgumentException("Must be a child of DSLink");
42-
}
43-
4434
}

dslink-v2/src/main/java/org/iot/dsa/node/DSFlexEnum.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ public DSFlexEnum valueOf(DSElement arg) {
132132
if ((arg == null) || arg.isNull()) {
133133
return NULL;
134134
}
135+
if (arg.isList()) {
136+
DSList list = arg.toList();
137+
return valueOf(list.first().toString(), list);
138+
}
135139
return valueOf(arg.toString());
136140
}
137141

0 commit comments

Comments
 (0)