Class CoreResourceFactory
java.lang.Object
org.jdrupes.builder.core.CoreResourceFactory
- All Implemented Interfaces:
ResourceFactory
A factory for creating the Core resource objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> booleanaddsMethod(Class<T> base, Class<? extends T> derived) Checks if the derived interface adds any methods to the base interface.newResource(ResourceType<T> type, Project project, Object... args) Returns a new resource of the given type if the factory instance can create it.
-
Constructor Details
-
CoreResourceFactory
public CoreResourceFactory()Instantiates a new core resource factory.
-
-
Method Details
-
addsMethod
Checks if the derived interface adds any methods to the base interface.- Type Parameters:
T- the generic type- Parameters:
base- the basederived- the derived- Returns:
- true, if successful
-
newResource
public <T extends Resource> Optional<T> newResource(ResourceType<T> type, Project project, Object... args) Description copied from interface:ResourceFactoryReturns a new resource of the given type if the factory instance can create it.- Specified by:
newResourcein interfaceResourceFactory- Type Parameters:
T- the generic resource type- Parameters:
type- the resource typeproject- the projectargs- the additional arguments- Returns:
- the result.
Optional.empty()if the resource cannot be created by the factory instance.
-