Menu

Home

Benjamin Hoskins

I've been messing around with reflection and serialization / de-serialization over the last few years in Java, and I got pretty tired of more or less writing the same code again and again with slightly different variations in use every time, so a consistent type conversion library and API was needed (I looked for one, and they all were quite old / too complex).

I was looking for a simple interface that could repeatably do conversion in one line, no matter how complex.

So:

import static uk.co.itstherules.jtype.JType.Convert;

...

String converted = Convert(value).to(String.class);
Long converted = Convert(value).to(Long.class);

Examples

[ReflectionExample]
[SerializationExample]


Related

Wiki: ReflectionExample
Wiki: SerializationExample