diff options
author | Ashlee Young <ashlee@wildernessvoice.com> | 2015-12-01 05:49:27 -0800 |
---|---|---|
committer | Ashlee Young <ashlee@wildernessvoice.com> | 2015-12-01 05:49:27 -0800 |
commit | e63291850fd0795c5700e25e67e5dee89ba54c5f (patch) | |
tree | 9707289536ad95bb739c9856761ad43275e07d8c /framework/src/onos/core/api/src/main/java/org/onosproject/net/newresource/ResourcePath.java | |
parent | 671823e12bc13be9a8b87a5d7de33da1bb7a44e8 (diff) |
onos commit hash c2999f30c69e50df905a9d175ef80b3f23a98514
Change-Id: I2bb8562c4942b6d6a6d60b663db2e17540477b81
Signed-off-by: Ashlee Young <ashlee@wildernessvoice.com>
Diffstat (limited to 'framework/src/onos/core/api/src/main/java/org/onosproject/net/newresource/ResourcePath.java')
-rw-r--r-- | framework/src/onos/core/api/src/main/java/org/onosproject/net/newresource/ResourcePath.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/newresource/ResourcePath.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/newresource/ResourcePath.java index d87682a9..c0c4e34f 100644 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/newresource/ResourcePath.java +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/newresource/ResourcePath.java @@ -56,6 +56,7 @@ public abstract class ResourcePath { * Creates an resource path which represents a discrete-type resource from the specified components. * * @param components components of the path. The order represents hierarchical structure of the resource. + * @return resource path instance */ public static ResourcePath discrete(Object... components) { if (components.length == 0) { @@ -70,6 +71,7 @@ public abstract class ResourcePath { * * @param value amount of the resource * @param components components of the path. The order represents hierarchical structure of the resource. + * @return resource path instance */ public static ResourcePath continuous(double value, Object... components) { return new Continuous(ImmutableList.copyOf(components), value); @@ -141,12 +143,27 @@ public abstract class ResourcePath { return Optional.ofNullable(parent); } + /** + * Returns a child resource path of this instance with specifying the child object. + * The child resource path is discrete-type. + * + * @param child child object + * @return a child resource path + */ public ResourcePath child(Object child) { checkState(this instanceof Discrete); return new Discrete((Discrete) this, child); } + /** + * Returns a child resource path of this instance with specifying a child object and + * value. The child resource path is continuous-type. + * + * @param child child object + * @param value value + * @return a child resource path + */ public ResourcePath child(Object child, double value) { checkState(this instanceof Discrete); @@ -197,6 +214,7 @@ public abstract class ResourcePath { * implementation only. It is not for resource API user. * </p> */ + @Beta public static final class Discrete extends ResourcePath { private Discrete() { super(); @@ -218,6 +236,7 @@ public abstract class ResourcePath { * Note: This class is exposed to the public, but intended to be used in the resource API * implementation only. It is not for resource API user. */ + @Beta public static final class Continuous extends ResourcePath { // Note: value is not taken into account for equality private final double value; |