hutcheb commented on a change in pull request #192:
URL: https://github.com/apache/plc4x/pull/192#discussion_r500144795



##########
File path: plc4j/api/src/main/java/org/apache/plc4x/java/api/value/PlcBYTE.java
##########
@@ -181,6 +205,90 @@ public short getShort() {
         return value;
     }
 
+    @Override
+    @JsonIgnore
+    public boolean isInteger() {
+        return true;
+    }
+
+    @Override
+    @JsonIgnore
+    public int getInteger() {
+        return value.intValue();
+    }
+

Review comment:
       I think there a at least two use cases for these methods. To use them 
when parsing the value within the dataio classes. The other is by the user when 
they need to parse the value to a specific type. 
   
   A generic function to be used when parsing like getValue() would be good.
   
   For the user the getInteger, getByte, etc.. might be good as I can't think 
of an easy way to pass a type to the function and have it return the data type 
requested without just putting the existing functions within a switch statement.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to