Interface ModifiedValueFunction<I,​O>

  • Type Parameters:
    I - the input type
    O - the output type
    All Superinterfaces:
    Function<I,​O>
    All Known Implementing Classes:
    CacheIntermediatePublisher

    public interface ModifiedValueFunction<I,​O>
    extends Function<I,​O>
    This is a special interface that can mark a Function so that a user can know if the actual value will change when the function is applied or not. This way a function can communicate if it is only observing values or modifying them to the invoker. This can allow the invoker in some cases to optimize a given code path knowing that the values are unchanged.

    It should be noted that "changed" can be different in a given context. For example if the underlying implementation utilized something similar to a EncodingFunction the result could be a different object completely but is essentially the same.

    • Method Detail

      • isModified

        boolean isModified()
        This method should return true when this function changes the actual values of the Publisher. This can be useful for some optimizations that may need to track produced values from the original.
        Returns:
        if the values in the publisher are changed