public static < T1 , T2 , T3 , R > Function3 < T1 , T2 , T3 , R > memoizeTriFunction ( final Function3 < T1 , T2 , T3 , R > fn , final Cacheable < R > cache ) { Function1 < Tuple3 < T1 , T2 , T3 > , R > memoise2 = memoizeFunction ( ( final Tuple3 < T1 , T2 , T3 > triple ) -> fn . apply ( triple . _1 ( ) , triple . _2 ( ) , triple . _3 ( ) ) , cache ) ; return ( t1 , t2 , t3 ) -> memoise2 . apply ( tuple ( t1 , t2 , t3 ) ) ; }
Convert a TriFunction into one that caches it s result