public class ResourcePoolsImpl extends java.lang.Object implements ResourcePools, HumanReadable
ResourcePools
interface.Constructor and Description |
---|
ResourcePoolsImpl(java.util.Map<ResourceType<?>,ResourcePool> pools) |
Modifier and Type | Method and Description |
---|---|
<P extends ResourcePool> |
getPoolForResource(ResourceType<P> resourceType)
Gets a specific
ResourcePool based on its type. |
java.util.Set<ResourceType<?>> |
getResourceTypeSet()
Gets the set of
ResourceType s present in the ResourcePools . |
java.lang.String |
readableString() |
ResourcePools |
validateAndMerge(ResourcePools toBeUpdated)
Get a copy of this
ResourcePools merged with the given ResourcePools , validating that
the updates to the contained ResourcePool s are legal. |
static void |
validateResourcePools(java.util.Collection<? extends ResourcePool> pools)
Validates some required relationships between
core resources . |
public ResourcePoolsImpl(java.util.Map<ResourceType<?>,ResourcePool> pools)
public <P extends ResourcePool> P getPoolForResource(ResourceType<P> resourceType)
ResourcePool
based on its type.getPoolForResource
in interface ResourcePools
P
- specific resource pool typeresourceType
- the type of resource the pool is trackingResourcePool
, or null if there is no pool of the requested type.public java.util.Set<ResourceType<?>> getResourceTypeSet()
ResourceType
s present in the ResourcePools
.getResourceTypeSet
in interface ResourcePools
ResourceType
public ResourcePools validateAndMerge(ResourcePools toBeUpdated)
ResourcePools
merged with the given ResourcePools
, validating that
the updates to the contained ResourcePool
s are legal.validateAndMerge
in interface ResourcePools
toBeUpdated
- the ResourcePools
to merge with the current one.ResourcePools
public static void validateResourcePools(java.util.Collection<? extends ResourcePool> pools)
core resources
.pools
- the resource pools to validatepublic java.lang.String readableString()
readableString
in interface HumanReadable