Adding support to returning struct/list of struct objects
[iot2.git] / iotjava / iotrmi / Java / sample / TestClass.java
index d8d78bc21721dd57810e311d6946f7c58b638786..6d547ba518dea23b29193f274826312810057410 100644 (file)
@@ -145,13 +145,22 @@ public class TestClass implements TestClassInterface {
                return sum;
        }
 
-       public void handleStruct(StructJ[] data) {
+       public StructJ[] handleStruct(StructJ[] data) {
 
                for (StructJ str : data) {
                        System.out.println("Name: " + str.name);
                        System.out.println("Value: " + str.value);
                        System.out.println("Year: " + str.year);
                }
+
+               StructJ test = new StructJ();
+               test.name = "Anonymous";
+               test.value = 1.33f;
+               test.year = 2016;
+
+               data[0] = test;
+
+               return data;
        }