Class MapperUtils


  • @Deprecated(since="0.3.1")
    public class MapperUtils
    extends java.lang.Object
    Deprecated.
    Some basic util methods for Data Mappers
    Since:
    0.2
    • Method Detail

      • tryAndReturnOrLog

        @Deprecated(since="0.3.1")
        public static <T> java.util.Optional<T> tryAndReturnOrLog​(@NonNull java.util.function.Supplier<T> supplier)
        Deprecated.
        Executes supplier and returns Optional.empty() if an IgnorableMappingException occurs. The exceptions message will be logged as error.
        Type Parameters:
        T - The type of the supplied value
        Parameters:
        supplier - The supplier to be executed
        Returns:
        An optional containing the supplied value or empty option.
      • tryAndReturnOrLog

        @Deprecated(since="0.3.1")
        public static <T> java.util.Optional<T> tryAndReturnOrLog​(@NonNull java.util.function.Supplier<T> supplier,
                                                                  @NonNull org.slf4j.Logger logger)
        Deprecated.
        Executes supplier and returns Optional.empty() if an IgnorableMappingException occurs. The exceptions message will be logged as error.
        Type Parameters:
        T - The type of the supplied value
        Parameters:
        supplier - The supplier to be executed
        logger - The logger to be used for logging the exception message
        Returns:
        An optional containing the supplied value or empty option.