public final class GoogleGsonSerializerHelper {
public Gson createGsonBuilder(final boolean prettyPrint) {
final GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(LocalDate.class, new JodaLocalDateAdapter());
builder.registerTypeAdapter(DateTime.class, new JodaDateTimeAdapter());
builder.registerTypeAdapter(MonthDay.class, new JodaMonthDayAdapter());
if (prettyPrint) {
builder.setPrettyPrinting();
}
return builder.create();