Adapter framework for converting between different Java types