Skip to content

Don't let ParseCallback extend BiFunction #89

@Marcono1234

Description

@Marcono1234

Problem

Currently ParseCallback extends java.util.function.BiFunction. That requires it to use the boxed type Integer as parameter instead of the primitive type int. This might cause some performance overhead due to boxing and unboxing (I haven't measured it though).

Suggested solution

Don't let ParseCallback extend java.util.function.BiFunction. Even without extending BiFunction users can use a lambda expression or method reference for this interface. And you can then freely choose parameter and return types.

I am not sure if extending BiFunction provides much or any advantages. For example the default methods such as BiFunction#andThen return a BiFunction, so they cannot be used for anything which expects a ParseCallback.

What do you think?

(This also applies to Logger which extends BiConsumer.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions