aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/core/api/src/main/java/org/onosproject/net/config/SubjectFactory.java
diff options
context:
space:
mode:
authorAshlee Young <ashlee@onosfw.com>2015-10-09 18:32:44 -0700
committerAshlee Young <ashlee@onosfw.com>2015-10-09 18:32:44 -0700
commit6a07d2d622eaa06953f3353e39c080984076e8de (patch)
treebfb50a2090fce186c2cc545a400c969bf2ea702b /framework/src/onos/core/api/src/main/java/org/onosproject/net/config/SubjectFactory.java
parente6d71622143ff9b2421a1abbe8434b954b5b1099 (diff)
Updated master to commit id 6ee8aa3e67ce89908a8c93aa9445c6f71a18f986
Change-Id: I94b055ee2f298daf71e2ec794fd0f2495bd8081f
Diffstat (limited to 'framework/src/onos/core/api/src/main/java/org/onosproject/net/config/SubjectFactory.java')
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/config/SubjectFactory.java26
1 files changed, 19 insertions, 7 deletions
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/config/SubjectFactory.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/config/SubjectFactory.java
index cd2db344..f992d727 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/config/SubjectFactory.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/config/SubjectFactory.java
@@ -28,7 +28,7 @@ import com.google.common.annotations.Beta;
public abstract class SubjectFactory<S> {
private final Class<S> subjectClass;
- private final String subjectKey;
+ private final String subjectClassKey;
/**
* Creates a new configuration factory for the specified class of subjects
@@ -36,12 +36,12 @@ public abstract class SubjectFactory<S> {
* subject and configuration class keys are used merely as keys for use in
* composite JSON trees.
*
- * @param subjectClass subject class
- * @param subjectKey subject class key
+ * @param subjectClass subject class
+ * @param subjectClassKey subject class key
*/
- protected SubjectFactory(Class<S> subjectClass, String subjectKey) {
+ protected SubjectFactory(Class<S> subjectClass, String subjectClassKey) {
this.subjectClass = subjectClass;
- this.subjectKey = subjectKey;
+ this.subjectClassKey = subjectClassKey;
}
/**
@@ -60,8 +60,20 @@ public abstract class SubjectFactory<S> {
*
* @return configuration key
*/
- public String subjectKey() {
- return subjectKey;
+ public String subjectClassKey() {
+ return subjectClassKey;
+ }
+
+ /**
+ * Returns the unique key of the specified configuration subject.
+ * This is primarily aimed for use in composite JSON trees in external
+ * representations and has no bearing on the internal behaviours.
+ *
+ * @param subject specific subject
+ * @return subject key
+ */
+ public String subjectKey(S subject) {
+ return subject.toString();
}
/**