You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@plc4x.apache.org by "chrisdutz (via GitHub)" <gi...@apache.org> on 2023/08/29 14:09:18 UTC

[PR] Feature/iec 60870 5 104

chrisdutz opened a new pull request, #1088:
URL: https://github.com/apache/plc4x/pull/1088

   So ... I've implemented the small change on adding a map of Metadata to the PlcValues (Per default they simply contain a reference to the emptyMap(), but as soon as someone calls addMetaData, it will pass along stuff. 
   
   Feel free to inspect the Iec608705104TagParser type for how to use it.


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Feature/iec 60870 5 104

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz commented on code in PR #1088:
URL: https://github.com/apache/plc4x/pull/1088#discussion_r1314648472


##########
plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcNull.java:
##########
@@ -271,6 +271,21 @@ public PlcValue getValue(String key) {
         return null;
     }
 
+    @Override
+    public Map<String, PlcValue> getMetaData() {
+        return null;

Review Comment:
   Fixed



-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Feature/iec 60870 5 104

Posted by "sruehl (via GitHub)" <gi...@apache.org>.
sruehl commented on code in PR #1088:
URL: https://github.com/apache/plc4x/pull/1088#discussion_r1311253205


##########
plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcNull.java:
##########
@@ -271,6 +271,21 @@ public PlcValue getValue(String key) {
         return null;
     }
 
+    @Override
+    public Map<String, PlcValue> getMetaData() {
+        return null;

Review Comment:
   Maybe provide a `collections.emptyMap()` (or however this is called, might be a static variable too) just to avoid NPEs when calling it



##########
plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcNull.java:
##########
@@ -271,6 +271,21 @@ public PlcValue getValue(String key) {
         return null;
     }
 
+    @Override
+    public Map<String, PlcValue> getMetaData() {
+        return null;

Review Comment:
   or if it extends PLC Value adapter remove those implementations here



-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Feature/iec 60870 5 104

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz commented on PR #1088:
URL: https://github.com/apache/plc4x/pull/1088#issuecomment-1700463740

   So ... I guess I'll be merging this tomorrow, if I don't hear any opposition.


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Feature/iec 60870 5 104

Posted by "sruehl (via GitHub)" <gi...@apache.org>.
sruehl commented on code in PR #1088:
URL: https://github.com/apache/plc4x/pull/1088#discussion_r1311251604


##########
plc4j/api/src/main/java/org/apache/plc4x/java/api/value/PlcValue.java:
##########
@@ -149,4 +149,10 @@ public interface PlcValue {
 
     Map<String, ? extends PlcValue> getStruct();
 
+    Map<String, PlcValue> getMetaData();
+
+    boolean hasMetaData(String key);
+
+    PlcValue getMetaData(String key);

Review Comment:
   not sure if those are worth it if you expose a map anyway. This just bloats the API



##########
plc4j/api/src/main/java/org/apache/plc4x/java/api/value/PlcValue.java:
##########
@@ -149,4 +149,10 @@ public interface PlcValue {
 
     Map<String, ? extends PlcValue> getStruct();
 
+    Map<String, PlcValue> getMetaData();
+
+    boolean hasMetaData(String key);

Review Comment:
   not sure if those are worth it if you expose a map anyway. This just bloats the API



-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Feature/iec 60870 5 104

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz merged PR #1088:
URL: https://github.com/apache/plc4x/pull/1088


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Feature/iec 60870 5 104

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz commented on code in PR #1088:
URL: https://github.com/apache/plc4x/pull/1088#discussion_r1311272228


##########
plc4j/api/src/main/java/org/apache/plc4x/java/api/value/PlcValue.java:
##########
@@ -149,4 +149,10 @@ public interface PlcValue {
 
     Map<String, ? extends PlcValue> getStruct();
 
+    Map<String, PlcValue> getMetaData();
+
+    boolean hasMetaData(String key);
+
+    PlcValue getMetaData(String key);

Review Comment:
   Guess I mainly added it, because we did it in the rest of the API.



-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Feature/iec 60870 5 104

Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz commented on code in PR #1088:
URL: https://github.com/apache/plc4x/pull/1088#discussion_r1314648891


##########
plc4j/api/src/main/java/org/apache/plc4x/java/api/value/PlcValue.java:
##########
@@ -149,4 +149,10 @@ public interface PlcValue {
 
     Map<String, ? extends PlcValue> getStruct();
 
+    Map<String, PlcValue> getMetaData();
+
+    boolean hasMetaData(String key);
+
+    PlcValue getMetaData(String key);

Review Comment:
   I actually removed the raw map access.



-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@plc4x.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org