Package fluent.types
Interface FluentValueFactory
- All Known Implementing Classes:
DefaultFluentValueFactory
public interface FluentValueFactory
Interface for factories used to create the appropriate FluentValue for a given Object
-
Method Summary
Modifier and TypeMethodDescription<T> List<FluentValue<?>>
toCollection(T in)
Collection mapper.<T> FluentValue<?>
toFluentValue(T any)
Map objects to FluentValues.default <T> FluentValue<?>
toFluentValueNullsafe(T any)
Nullsafe mapper.
-
Method Details
-
toFluentValue
Map objects to FluentValues.It is not guaranteed that the FluentValue type will be the same as the input type.
See FluentValueFactory for default mappings.
- Type Parameters:
T
- type- Parameters:
any
- non-null input- Returns:
- FluentValue
-
toFluentValueNullsafe
Nullsafe mapper.All null objects will be of the same type (FluentString, with a String value of "null"). nulls will therefore be handled as FluentStrings. A null input should be considered an error. Nullsafe mapping, however, allows a higher chance of a message to be constructed in the event of a program error.
- Type Parameters:
T
- any type- Parameters:
any
- input- Returns:
- FluentValue created
-
toCollection
Collection mapper.- Returns:
- return the Collection as a List of FluentValues.
-