diff options
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; |