@FunctionalInterface implications
Brian Goetz
brian.goetz at oracle.com
Fri Nov 22 17:32:32 PST 2013
Function is extended by BinaryOperator, also a functional interface,
which specializes its type parameters. I think that's a fine pattern.
More generally, its perfectly fine for an interface to extend a
functional interface but not itself be a functional interface. See
Node.Builder inside the Stream package, for example.
On 11/22/2013 7:50 PM, Richard Warburton wrote:
> Hi,
>
> If the intent of an interface marked with @FunctionalInterface is to be
> used as such then should it ever be extended by another interface?
>
> I appreciate there are probably enough complex interactions that generating
> a compile error if this happens would be too restrictive but what about
> 'morally' or as a guideline?
>
> regards,
>
> Richard Warburton
>
> http://insightfullogic.com
> @RichardWarburto <http://twitter.com/richardwarburto>
>
More information about the lambda-dev
mailing list