Add hasBehaviour to DriverHandler
Change-Id: I2bcfb06795b923de4356937a0baee35b37c7d979
diff --git a/core/api/src/main/java/org/onosproject/net/driver/DriverHandler.java b/core/api/src/main/java/org/onosproject/net/driver/DriverHandler.java
index 202708b..723e692 100644
--- a/core/api/src/main/java/org/onosproject/net/driver/DriverHandler.java
+++ b/core/api/src/main/java/org/onosproject/net/driver/DriverHandler.java
@@ -44,6 +44,17 @@
<T extends Behaviour> T behaviour(Class<T> behaviourClass);
/**
+ * Indicates whether or not the driver, or any of its parents, support
+ * the specified class of behaviour.
+ *
+ * @param behaviourClass behaviour class
+ * @return true if behaviour is supported
+ */
+ default boolean hasBehaviour(Class<? extends Behaviour> behaviourClass) {
+ return driver().hasBehaviour(behaviourClass);
+ }
+
+ /**
* Returns the reference to the implementation of the specified service.
* Provides access to run-time context.
*