Interface ResourceQuery<T extends Resource>
- Type Parameters:
T- the collected type
- All Known Implementing Classes:
DefaultResourceQuery
public interface ResourceQuery<T extends Resource>
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 TypeMethodDescriptionResourceType<? extends T> type()Return the requested type.uses()default ResourceQuery<T> default ResourceQuery<T> usingAll()booleanwants(ResourceType<?> type) Checks if the query accepts results of the given type.
-
Method Details
-
type
-
using
-
using
-
usingAll
-
uses
-
wants
Checks if the query accepts results of the given type.- Parameters:
type- the type to check- Returns:
- true, if successful
-