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 Details

    • toFluentValue

      <T> FluentValue<?> toFluentValue(@NotNull T any)
      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

      default <T> FluentValue<?> toFluentValueNullsafe(@Nullable T any)
      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

      <T> List<FluentValue<?>> toCollection(@NotNull T in)
      Collection mapper.
      Returns:
      return the Collection as a List of FluentValues.