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 java.lang.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(java.lang.Class<?> child)
Returns a resource ID of a child of this resource based on the specified object.abstract DiscreteResourceId
child(java.lang.Object child)
Returns a resource ID of a child of this resource based on the specified object.abstract java.util.Optional<DiscreteResourceId>
parent()
Returns the parent resource ID of this instance.
-
-
-
Method Detail
-
parent
public abstract java.util.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(java.lang.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(java.lang.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
-
-