Interface OptionalMapper


public interface OptionalMapper
  • Method Summary

    Modifier and Type
    Method
    Description
    default <T> T
    unwrapOptional(@NonNull Optional<T> optional)
    Returns the object enclosed by an Optional
  • Method Details

    • unwrapOptional

      @Contract(pure=true) @Nullable default <T> T unwrapOptional(@NonNull @NonNull Optional<T> optional)
      Returns the object enclosed by an Optional
      Type Parameters:
      T - The class of the object inside the Optional.
      Parameters:
      optional - The Optional that shall be unwrapped.
      Returns:
      The value of the given Optional or null if it is empty.