Class DefaultResourceQuery<T extends Resource>
java.lang.Object
org.jdrupes.builder.core.DefaultResourceQuery<T>
- Type Parameters:
T- the generic type
- All Implemented Interfaces:
ResourceQuery<T>
Represents a request for Resources of a specified type.
The specified type provides two kinds of type information:
- The type of the
Resources that are actually provided. - The type of the "context" in which the
Resources are to be provided.
As an example, consider requests for a compile time and a runtime
classpath. In both cases, the actually provided Resources are
of type "classpath element". However, depending on the kind of
classpath, a ResourceProvider may deliver different collections of
instances of "classpath elements". So instead of requesting
"classpath element",
Not all requested resource types require context information. For
example, a request for Cleanliness usually refers to all resources
that a Generator has created and does not depend on a context.
However, in order to keep the API simple, the context is always
required.
-
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()toString()ResourceType<? extends T> type()Return the requested type.uses()booleanwants(ResourceType<?> type) Checks if the query accepts results of the given type.Methods inherited from interface ResourceQuery
using, usingAll
-
Method Details
-
using
- Specified by:
usingin interfaceResourceQuery<T extends Resource>
-
uses
-
type
Description copied from interface:ResourceQueryReturn the requested type.- Specified by:
typein interfaceResourceQuery<T extends Resource>- Returns:
- the resource type
-
wants
Description copied from interface:ResourceQueryChecks if the query accepts results of the given type.- Specified by:
wantsin interfaceResourceQuery<T extends Resource>- Parameters:
type- the type to check- Returns:
- true, if successful
-
hashCode
-
equals
-
toString
-