Class DefaultResourceRequest<T extends Resource>
java.lang.Object
org.jdrupes.builder.core.DefaultResourceRequest<T>
- Type Parameters:
T- the resource type
- All Implemented Interfaces:
Cloneable, ResourceRequest<T>
public class DefaultResourceRequest<T extends Resource>
extends Object
implements ResourceRequest<T>
An implementation of
ResourceRequest.-
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepts(ResourceType<?> type) Returns true if resources of the given type satisfy this request.clone()booleaninthashCode()booleanisFor(ResourceType<?> type) Returns true if this request explicitly targets the type argument.name()Returns the name that the requested resource should have.toString()ResourceType<? extends T> type()Returns the requested type.uses()Returns the intents to be used for selecting providers.Returns a new resource request that uses project providers with the given intents.Returns a new resource request for a resource with the given name.Methods inherited from interface ResourceRequest
using, usingAll
-
Method Details
-
clone
-
type
Description copied from interface:ResourceRequestReturns the requested type.- Specified by:
typein interfaceResourceRequest<T extends Resource>- Returns:
- the resource type
-
withName
Description copied from interface:ResourceRequestReturns a new resource request for a resource with the given name.
Support for resource names is optional and provider-specific. Expect the name to be ignored if not explicitly supported for a given resource type and provider.
- Specified by:
withNamein interfaceResourceRequest<T extends Resource>- Parameters:
name- the name- Returns:
- the resource request
-
name
Description copied from interface:ResourceRequestReturns the name that the requested resource should have.- Specified by:
namein interfaceResourceRequest<T extends Resource>- Returns:
- the name if set
-
using
Description copied from interface:ResourceRequestReturns a new resource request that uses project providers with the given intents.- Specified by:
usingin interfaceResourceRequest<T extends Resource>- Parameters:
intents- the intents- Returns:
- the resource request
-
uses
Description copied from interface:ResourceRequestReturns the intents to be used for selecting providers.- Specified by:
usesin interfaceResourceRequest<T extends Resource>- Returns:
- the intents
-
accepts
Description copied from interface:ResourceRequestReturns true if resources of the given type satisfy this request. This method is typically used by providers to decide whether to provide their resources of that type in response to the request.
Technically, this is the same as
type().isAssignableFrom(type).- Specified by:
acceptsin interfaceResourceRequest<T extends Resource>- Parameters:
type- the type to check- Returns:
- true if resources of the type would satisfy this request
-
isFor
Description copied from interface:ResourceRequestReturns true if this request explicitly targets the type argument. This method is typically used by providers that can provide variants of a resource type to check which variant should be provided.
Technically, this is the same as
type.isAssignableFrom(type()).- Specified by:
isForin interfaceResourceRequest<T extends Resource>- Parameters:
type- the type to check- Returns:
- true, if successful
-
hashCode
-
equals
-
toString
-