public static interface ResourceProvider.Builder
Builder instances can be reused, it is safe to call build()
multiple times to build multiple resource providers in series.
Modifier and Type | Method and Description |
---|---|
<L extends Listener> |
add(java.lang.Class<L> type,
Resource<? super L> resource)
Adds resource implementation to the built resource provider.
|
ResourceProvider |
build()
Returns a newly created resource provider.
|
ResourceProvider.Builder |
parent(ResourceProvider provider)
Sets the parent resource provider of the built resource provider.
|
<L extends Listener> ResourceProvider.Builder add(java.lang.Class<L> type, Resource<? super L> resource)
type
- the listener type with which the given resource
is to be associated, not null
resource
- the resource to be associated with the given
listener type, not null
Builder
objectjava.lang.NullPointerException
- if type
or resource
is null
ResourceProvider.Builder parent(ResourceProvider provider)
provider
- the parent provider, not null
Builder
objectjava.lang.NullPointerException
- if the provider is null
java.lang.IllegalStateException
- if the provider is already setResourceProvider build()