Class ResourceAllocation


  • @Beta
    public class ResourceAllocation
    extends java.lang.Object
    Represents allocation of resource which is identified by the specifier.
    • Constructor Detail

      • ResourceAllocation

        public ResourceAllocation​(Resource resource,
                                  ResourceConsumerId consumerId)
        Creates an instance with the specified subject, resource and consumerId.
        Parameters:
        resource - resource of the subject
        consumerId - 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 subject
        consumer - 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 class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object