Package org.onosproject.net.resource
Class ResourceAllocation
- java.lang.Object
-
- org.onosproject.net.resource.ResourceAllocation
-
@Beta public class ResourceAllocation extends Object
Represents allocation of resource which is identified by the specifier.
-
-
Constructor Summary
Constructors Constructor Description ResourceAllocation(Resource resource, ResourceConsumer consumer)Creates an instance with the specified subject, resource and consumer.ResourceAllocation(Resource resource, ResourceConsumerId consumerId)Creates an instance with the specified subject, resource and consumerId.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceConsumerIdconsumerId()Returns ID of the consumer of this resource.booleanequals(Object obj)inthashCode()Resourceresource()Returns the specifier of the resource this allocation uses.StringtoString()
-
-
-
Constructor Detail
-
ResourceAllocation
public ResourceAllocation(Resource resource, ResourceConsumerId consumerId)
Creates an instance with the specified subject, resource and consumerId.- Parameters:
resource- resource of the subjectconsumerId- consumer ID of this resource
-
ResourceAllocation
public ResourceAllocation(Resource resource, ResourceConsumer consumer)
Creates an instance with the specified subject, resource and consumer.- Parameters:
resource- resource of the subjectconsumer- consumer of this resource
-
-
Method Detail
-
resource
public Resource resource()
Returns the specifier of the resource this allocation uses.- Returns:
- the specifier of the resource this allocation uses
-
consumerId
public ResourceConsumerId consumerId()
Returns ID of the consumer of this resource.- Returns:
- ID of the consumer of this resource
-
-