I have the following Java class and I want to serialize it to JSON using Jackson:

```
public class Event
   boolean allDay;
   Date start;
   Date end;

   // get/set
}

```

But I want to format the Dates as "yyyy-MM-dd" when allDay is true and "yyyy-MM-dd HH:mm" when allDay is false. Is that possible?