Stas Kurilin Stas Kurilin - 11 months ago 71
Java Question

Is there a bidirectional function in Guava?

So, I need function with API like

interface BiFunction<A, B> {
B aToB(A input);
A bToA(B input);

Does Guava provided smt like this. If no, what names you would suggest for


No, there isn't anything like this in Guava currently. Something like it may be coming (see this issue, as well as this issue for some related discussion).

For names, I don't know what would be best but I'd prefer something like apply and applyInverse over aToB and bToA.