Skip to content

Commit 33651d8

Browse files
committed
refactor: Added a "getSupportedSubscriptionTypes()" method to PlcBrowseItem
1 parent e500139 commit 33651d8

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcBrowseItem.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@
2020

2121
import org.apache.plc4x.java.api.model.ArrayInfo;
2222
import org.apache.plc4x.java.api.model.PlcTag;
23+
import org.apache.plc4x.java.api.types.PlcSubscriptionType;
2324
import org.apache.plc4x.java.api.value.PlcValue;
2425

26+
import java.util.Collections;
2527
import java.util.List;
2628
import java.util.Map;
29+
import java.util.Set;
2730

2831
public interface PlcBrowseItem {
2932

@@ -48,9 +51,19 @@ public interface PlcBrowseItem {
4851
boolean isWritable();
4952

5053
/**
51-
* @return returns 'true' if we can subscribe this variable.
54+
* @return the set of subscription types this variable supports. An empty set means the
55+
* variable is not subscribable. Implementations must never return {@code null}.
5256
*/
53-
boolean isSubscribable();
57+
default Set<PlcSubscriptionType> getSupportedSubscriptionTypes() {
58+
return Collections.emptySet();
59+
}
60+
61+
/**
62+
* @return returns 'true' if we can subscribe this variable in any subscription mode.
63+
*/
64+
default boolean isSubscribable() {
65+
return !getSupportedSubscriptionTypes().isEmpty();
66+
}
5467

5568
/**
5669
* @return returns 'true' if we can publish this variable.

0 commit comments

Comments
 (0)