Interface HasReturnType<R>

All Known Subinterfaces:
IntermediateOperation<S,R>, TerminalOperation<S,R>

public interface HasReturnType<R>
  • Method Summary

    Modifier and Type
    Method
    Description
    Class<? super R>
    Returns the return type of the operation.
  • Method Details

    • returnType

      Class<? super R> returnType()
      Returns the return type of the operation.

      Potential return types for terminating operations include:

      • long.class, e.g. for count()
      • Object.class, e.g. for collect()
      • void.class, e.g. for forEach()
      • boolean.class, e.g. for anyMatch()
      • Object[].class, e.g. for toArray()
      • Optional.class, e.g. for findAny()

      Return types for intermediate operations include:

      Returns:
      the return type of the terminating operation