Please note that the specifications and other information contained herein are not final and are subject to change. The information is being made available to you solely for purpose of evaluation.
Java™ Platform
Standard Ed. 8

DRAFT ea-b92

Package java.util.function

Functional interfaces provide target types for lambda expressions and method references.

See: Description

Package java.util.function Description

Functional interfaces provide target types for lambda expressions and method references. Each functional interface has a single abstract method to which the lambda expression's parameter and return types are matched or adapted. Functional interfaces can provide a target type in multiple contexts, such as assignment context, method invocation, or cast context:
     Predicate<String> p = String::isEmpty;

     stream.filter(e -> e.getSize() > 10)...

     stream.map((ToIntFunction) e -> e.getSize())...
 

The interfaces in this package are functional interfaces used by the JDK, and are available to be used by user code as well. While they do not identify a complete set of function shapes to which lambda expressions might be adapted, they provide enough to cover common requirements.

The interfaces in this package are annotated with @{link FunctionalInterface}. This annotation is not a requirement for the compiler to recognize an interface as a functional interface, but merely an aid to capture design intent and enlist the help of the compiler in identifying accidental violations of design intent.

The functional interfaces in this package follow an extensible naming convention, as follows:

See Also:
FunctionalInterface
Java™ Platform
Standard Ed. 8

DRAFT ea-b92

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.

DRAFT ea-b92




Spec-Zone.ru - all specs in one place