commit | 003ed3273e1c7965cbfec61cb9896ba8dbfff8a6 | [log] [tgz] |
---|---|---|
author | Sho SHIMIZU <sshimizu@us.fujitsu.com> | Thu Feb 11 12:58:42 2016 -0800 |
committer | Gerrit Code Review <gerrit@onlab.us> | Wed Feb 17 00:37:09 2016 +0000 |
tree | 8c93c26a68d6a69b42a6977c51ccd35f52255f15 | |
parent | 2703980ee4d448d8834b3b73fa2e030000f120f6 [diff] [blame] |
Add a method to check the type of resource Change-Id: If4b44688c0a93a43dfa9a4c2cb77c52599159751
diff --git a/core/api/src/main/java/org/onosproject/net/newresource/ContinuousResource.java b/core/api/src/main/java/org/onosproject/net/newresource/ContinuousResource.java index fcfcdd5..a55124e 100644 --- a/core/api/src/main/java/org/onosproject/net/newresource/ContinuousResource.java +++ b/core/api/src/main/java/org/onosproject/net/newresource/ContinuousResource.java
@@ -48,6 +48,14 @@ return id; } + @Override + public boolean isTypeOf(Class<?> type) { + checkNotNull(type); + + String typeName = (String) id.components().get(id.components().size() - 1); + return typeName.equals(type.getCanonicalName()); + } + /** * The user of this methods must receive the return value as Double or double. * Otherwise, this methods throws an exception.