Package cs2030s.fp

Interface Immutator<R,​P>

  • Type Parameters:
    R - The type of the result value.
    P - The type of the input value.
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface Immutator<R,​P>
    Represent a function that immutate one value into another, possible of different types. CS2030S Lab 5 AY22/23 Semester 1
    • Method Detail

      • invoke

        R invoke​(P p)
        The functional method to immutate the value p.
        Parameters:
        p - The input value.
        Returns:
        The value after applying the given immutation on p.