Stas Kurilin Stas Kurilin - 1 year ago 103
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

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download