Interface Function<F,​T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      T apply​(F input)
      Returns the result of applying this function to input.
      boolean equals​(java.lang.Object object)
      May return true if is a Function that behaves identically to this function.
    • Method Detail

      • apply

        @Nullable
        T apply​(@Nullable
                F input)
        Returns the result of applying this function to input. This method is generally expected, but not absolutely required, to have the following properties:
        • Its execution does not cause any observable side effects.
        • The computation is consistent with equals; that is, Objects.equal(a, b) implies that Objects.equal(function.apply(a), function.apply(b)).
        Throws:
        java.lang.NullPointerException - if input is null and this function does not accept null arguments
      • equals

        boolean equals​(@Nullable
                       java.lang.Object object)
        May return true if is a Function that behaves identically to this function.

        Warning: do not depend on the behavior of this method.

        Historically, Function instances in this library have implemented this method to recognize certain cases where distinct Function instances would in fact behave identically. However, as code migrates to java.util.function, that behavior will disappear. It is best not to depend on it.

        Overrides:
        equals in class java.lang.Object