Package org.onosproject.net.resource
Class ResourceAllocation
- java.lang.Object
-
- org.onosproject.net.resource.ResourceAllocation
-
@Beta public class ResourceAllocation extends java.lang.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 ResourceConsumerId
consumerId()
Returns ID of the consumer of this resource.boolean
equals(java.lang.Object obj)
int
hashCode()
Resource
resource()
Returns the specifier of the resource this allocation uses.java.lang.String
toString()
-
-
-
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:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-