Package org.onosproject.net.resource
Class ResourceId
- java.lang.Object
-
- org.onosproject.net.resource.ResourceId
-
- Direct Known Subclasses:
ContinuousResourceId
,DiscreteResourceId
@Beta public abstract class ResourceId extends Object
Represents identifier of resource.
-
-
Constructor Summary
Constructors Constructor Description ResourceId()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract ContinuousResourceId
child(Class<?> child)
Returns a resource ID of a child of this resource based on the specified object.abstract DiscreteResourceId
child(Object child)
Returns a resource ID of a child of this resource based on the specified object.abstract Optional<DiscreteResourceId>
parent()
Returns the parent resource ID of this instance.
-
-
-
Method Detail
-
parent
public abstract Optional<DiscreteResourceId> parent()
Returns the parent resource ID of this instance.- Returns:
- the parent resource ID of this instance. If there is no parent, empty instance will be returned.
-
child
public abstract DiscreteResourceId child(Object child)
Returns a resource ID of a child of this resource based on the specified object. If the given object is aClass
instance,IllegalArgumentException
is thrown.- Parameters:
child
- the last component of the child- Returns:
- a child resource ID
-
child
public abstract ContinuousResourceId child(Class<?> child)
Returns a resource ID of a child of this resource based on the specified object.- Parameters:
child
- the last component of the child- Returns:
- a child resource ID
-
-