nus/Lab6/cs2030s/fp/Immutator.java
Yadunand Prem cdc460bdc7 add lab6
2022-11-08 18:03:40 +08:00

20 lines
507 B
Java

package cs2030s.fp;
/**
* Represent a function that immutate one value into another, possible of different types.
* CS2030S Lab 5
* AY22/23 Semester 1
*
* @param <R> The type of the result value.
* @param <P> The type of the input value.
*/
@FunctionalInterface
public interface Immutator<R, P> {
/**
* The functional method to immutate the value p.
*
* @param p The input value.
* @return The value after applying the given immutation on p.
*/
R invoke(P p);
}