Package org.onosproject.net.resource
Class ContinuousResource
- java.lang.Object
- 
- org.onosproject.net.resource.ContinuousResource
 
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ContinuousResourcechild(Class<?> child, double value)Returns a child resource of this instance with specifying a child object and value.DiscreteResourcechild(Object child)Returns a child resource of this instance with specifying the child object.booleanequals(Object obj)inthashCode()ContinuousResourceIdid()Returns the ID of this resource.booleanisSubTypeOf(Class<?> ancestor)Checks if the type of this instance is the sub-type of the specified type.booleanisTypeOf(Class<?> type)Checks if the type of this instance is the specified type.Optional<DiscreteResource>parent()Returns the parent resource of this instance.StringsimpleTypeName()Returns the simple type name of this resource.StringtoString()doublevalue()Returns the value of the resource amount.<T> Optional<T>valueAs(Class<T> type)Returns value interpreted as the specified type.
 
- 
- 
- 
Method Detail- 
idpublic ContinuousResourceId id() Description copied from interface:ResourceReturns the ID of this resource.
 - 
simpleTypeNamepublic String simpleTypeName() Description copied from interface:ResourceReturns the simple type name of this resource. Example:
 Resource: DeviceId:1/PortNumber:1/VlanId:200
 Simple type name: VlanId- Specified by:
- simpleTypeNamein interface- Resource
- Returns:
- the simple type name of this resource
 
 - 
isTypeOfpublic boolean isTypeOf(Class<?> type) Description copied from interface:ResourceChecks if the type of this instance is the specified type.
 - 
valuepublic double value() Returns the value of the resource amount.- Returns:
- the value of the resource amount
 
 - 
isSubTypeOfpublic boolean isSubTypeOf(Class<?> ancestor) Description copied from interface:ResourceChecks if the type of this instance is the sub-type of the specified type.- Specified by:
- isSubTypeOfin interface- Resource
- Parameters:
- ancestor- type of resource to be checked.
- Returns:
- true if this resource is under the resource whose type is the given type.
 
 - 
valueAspublic <T> Optional<T> valueAs(Class<T> type) Returns value interpreted as the specified type. If the specified type is incompatible with the underlying value, an empty instance is returned. A user must specify Double.class or double.class to avoid an empty value.
 - 
childpublic DiscreteResource child(Object child) Description copied from interface:ResourceReturns a child resource of this instance with specifying the child object. It is not allowed that a continuous type resource has a child. If the instance is ContinuousResource,UnsupportedOperationExceptionis thrown. If the given object is aClassinstance,IllegalArgumentExceptionis thrown.
 - 
childpublic ContinuousResource child(Class<?> child, double value) Description copied from interface:ResourceReturns a child resource of this instance with specifying a child object and value. It is not allowed that a continuous type resource has a child. If the instance is ContinuousResource,UnsupportedOperationExceptionis thrown.
 - 
parentpublic Optional<DiscreteResource> parent() Description copied from interface:ResourceReturns the parent resource of this instance. E.g. if this resource is Link:1/VLAN ID:100, the return value is the resource for Link:1.
 
- 
 
-