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(java.lang.Class<?> child, double value)Returns a child resource of this instance with specifying a child object and value.DiscreteResourcechild(java.lang.Object child)Returns a child resource of this instance with specifying the child object.booleanequals(java.lang.Object obj)inthashCode()ContinuousResourceIdid()Returns the ID of this resource.booleanisSubTypeOf(java.lang.Class<?> ancestor)Checks if the type of this instance is the sub-type of the specified type.booleanisTypeOf(java.lang.Class<?> type)Checks if the type of this instance is the specified type.java.util.Optional<DiscreteResource>parent()Returns the parent resource of this instance.java.lang.StringsimpleTypeName()Returns the simple type name of this resource.java.lang.StringtoString()doublevalue()Returns the value of the resource amount.<T> java.util.Optional<T>valueAs(java.lang.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 java.lang.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(java.lang.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(java.lang.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> java.util.Optional<T> valueAs(java.lang.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(java.lang.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(java.lang.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 java.util.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.
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object obj) - Overrides:
- equalsin class- java.lang.Object
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-