C - The type of the context of a resulting FactoryHub.B - The type of the Builder implementation that utilizes this.public abstract static class FactoryHub.Collector<C,B> extends Object
FactoryHub intended for extension into a
Builder implementation.| Constructor and Description |
|---|
Collector() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract B |
getBuilder()
Returns the Builder instance that utilizes this.
|
<T> Function<Function<C,T>,B> |
on(T token)
Provides a two-step builder pattern to add a specific factory method and map it to a token:
Takes a token of a certain type as a parameter and returns a
Function that will associate that
token with a factory method (also a Function) and will return
the builder. |
B |
setUnknownTokenListener(Consumer<Object> consumer)
Defines a given consumer as the unknownTokenListener of a FactoryHub resulting from this Collector.
|
protected abstract B getBuilder()
public final <T> Function<Function<C,T>,B> on(T token)
Takes a token of a certain type as a parameter and returns a Function that will associate that
token with a factory method (also a Function) and will return
the builder.
T - The type of the token and also the result type of the production method.public final B setUnknownTokenListener(Consumer<Object> consumer)
Unless otherwise specified, FactoryUtil.ACCEPT_UNKNOWN_TOKEN is used as the unknownTokenListener.
Copyright © 2022 Andreas Kluge-Kaindl, Bremen (de). All rights reserved.