Package org.onosproject.net.resource
Class ResourceAllocation
- java.lang.Object
-
- org.onosproject.net.resource.ResourceAllocation
-
@Beta public class ResourceAllocation extends java.lang.ObjectRepresents 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(java.lang.Object obj)inthashCode()Resourceresource()Returns the specifier of the resource this allocation uses.java.lang.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
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-