Class ResourceType<T extends Resource>

java.lang.Object
org.jdrupes.builder.api.ResourceType<T>
Type Parameters:
T - the resource type

public class ResourceType<T extends Resource> extends Object

A special kind of type token for representing a resource type. The method rawType() returns the type as Class. If this class if derived from Resources, containedType() returns the ResourceType of the contained elements.

Beware of automatic inference of type arguments. The inferred type arguments will usually be super classes of what you expect.

An alternative to using an anonymous class to create a type token is to statically import the resourceType methods. Using these typically also results in clear code that is sometimes easier to read.