Pages

Saturday 16 March 2019

Creating you own TriFunction Interface in Java 8

Create your own TriFunctional Interface.


This Idea generally came when I was working with travel Domain Company, I used to have a lot of webservces to be merged into one which was nothing but output of the product.

So I have to comeup with API and Java 8 was into boom. and somehow I decided to extend a BiFunction and make my own TriFunction Interface.

@FunctionalInterface
public interface  TriFunction<W1,W2,WR> {
     /*
      * An Api method which will be used fro merginng two webservices and create new one
     */
    WR join(W1 w1, W2 w2);
}

Above example is just a short starter one which can be used in various APIS.