public interface LinenoteBuilder<T>
Linenotes.builder()
.Modifier and Type | Method and Description |
---|---|
<D> LinenoteBuilder<T> |
addDtoChoice(String label,
String description,
Supplier<D> dtoSupplier,
Function<D,T> factory)
Add a choice for a single parametrization.
|
<E extends Enum<E>> |
addEnumChoice(Class<E> p,
Function<E,T> factory)
Add a choice for each enum instances.
|
<D> LinenoteBuilder<T> |
addMultiDtoChoices(String label,
List<String> descriptions,
List<Supplier<D>> dtoSuppliers,
Function<D,T> factory)
Add multiple choices with multiple parameterizations.
|
LinenoteBuilder<T> |
addSimpleChoice(String label,
String description,
Supplier<T> factory)
Add a no-parameter choice.
|
Linenote<T> |
build()
Create factory.
|
LinenoteBuilder<T> addSimpleChoice(String label, String description, Supplier<T> factory)
label
- Choice labeldescription
- Choice descriptionfactory
- Factory to instantiate the represented choice<E extends Enum<E>> LinenoteBuilder<T> addEnumChoice(Class<E> p, Function<E,T> factory)
Description
annotation on its types.E
- Enum typep
- Enum typefactory
- Factory function to instantiate the represented choiceIllegalArgumentException
- when Description
annotations are missing on the passed enum.<D> LinenoteBuilder<T> addDtoChoice(String label, String description, Supplier<D> dtoSupplier, Function<D,T> factory)
Discovery.listParameters(java.lang.Object)
:
Parametrized
Description
and Parameter
annotations.
int
, long
, double
, enum
, string
and
boolean
types are supported.D
- Parameter object typelabel
- Choice labeldescription
- Choice descriptiondtoSupplier
- Parameter object supplierfactory
- Factory to instantiate based on the Dto state<D> LinenoteBuilder<T> addMultiDtoChoices(String label, List<String> descriptions, List<Supplier<D>> dtoSuppliers, Function<D,T> factory)
D
- Parameter object typelabel
- Choice labeldescriptions
- Descriptions for various parameterizationsdtoSuppliers
- Parameterizationsfactory
- Factory to instantiate based on parsed Dto