Interface HasMapIfPresent<T,​MAPPER,​RESULT extends HasMapIfPresent<T,​MAPPER,​RESULT>>

  • Type Parameters:
    T - the input entity type
    MAPPER - the functional interface used for mapping values
    All Known Subinterfaces:
    ToBooleanNullable<T>, ToByteNullable<T>, ToDoubleNullable<T>, ToEnumNullable<T,​E>, ToFloatNullable<T>, ToIntNullable<T>, ToLongNullable<T>, ToShortNullable<T>

    public interface HasMapIfPresent<T,​MAPPER,​RESULT extends HasMapIfPresent<T,​MAPPER,​RESULT>>
    Trait for expressions that can be mapped to a new expression of the same type by supplying a mapping function. If the value is present in the original expression, then it will be present in the new one as well. If the result of the original expression is null, then the new expression will evaluate to null also.
    Since:
    3.1.0
    Author:
    Emil Forslund
    • Method Detail

      • mapIfPresent

        RESULT mapIfPresent​(MAPPER mapper)
        Returns an expression for the value of this expression mapped using the specified mapping function. The input type remains the same.
        Parameters:
        mapper - the mapping function
        Returns:
        the mapped expression