0 Replies Latest reply on Mar 27, 2013 4:09 PM by Aleksandar Kostadinov

    benefirs of TwoWayKey2StringMapper

    Aleksandar Kostadinov Novice

      I was wondering what are the benefits of using TwoWayKey2StringMapper instead of only Key2StringMapper?


      I'm working on an app that has a custom typed key in one of the caches. I don't see a clean way to extend DefaultTwoWayKey2StringMapper to support that type as well. So I seem stuck between two options:

      1. have my own independent implementation for String and the custom type, and any other type I may use in the future implementing TwoWayKey2StringMapper

      2. implement only Key2StringMapper interface, handle only the custom type in my class and fallback to DefaultTwoWayKey2StringMapper for the other types


      Ideally I wanted to implement two-way conversion for the custom type and fallback to DefaultTwoWayKey2StringMapper for others but that doesn't seem straightforward. So I was wondering if there are there enough advantages in the #1 option to go for it.