commit | 82b3c11ecb84d1db27de0e197482eb5339af9079 | [log] [tgz] |
---|---|---|
author | HIGUCHI Yuta <y-higuchi@ak.jp.nec.com> | Thu Jan 07 22:22:26 2016 -0800 |
committer | Gerrit Code Review <gerrit@onlab.us> | Sun Jan 10 03:05:12 2016 +0000 |
tree | 0a496953ac3fa283d80939b932dc92c9d2f44136 | |
parent | 8514f4761822bc74608cb57ba38c67b16fcd66e4 [diff] |
Add hasBehaviour to DriverHandler Change-Id: I2bcfb06795b923de4356937a0baee35b37c7d979
diff --git a/core/api/src/main/java/org/onosproject/net/driver/Driver.java b/core/api/src/main/java/org/onosproject/net/driver/Driver.java index 3dc0fdb0..afb6ae6 100644 --- a/core/api/src/main/java/org/onosproject/net/driver/Driver.java +++ b/core/api/src/main/java/org/onosproject/net/driver/Driver.java
@@ -92,7 +92,7 @@ /** * Indicates whether or not the driver, or any of its parents, support - * the specified class of behaviour. It + * the specified class of behaviour. * * @param behaviourClass behaviour class * @return true if behaviour is supported
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. *