package bjc.utils.data; import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Function; public interface IPair { /** * Create a new pair by applying the given functions to the left/right. * Does not change the internal contents of this pair. * * @param lf * The function to apply to the left value. * @param rf * The function to apply to the right value. * @return A new pair containing the two modified values. */ IPair apply(Function lf, Function rf); /** * Collapse this pair to a single value. Does not change the internal * contents of this pair. * * @param bf * The function to use to collapse the pair. * @return The collapsed value. */ E merge(BiFunction bf); void doWith(BiConsumer bc); }