@Override public void writeData(DataOutput dataOutput, MonthDay value) throws IOException { if (value == null) { dataOutput.writeBoolean(false); } else { dataOutput.writeBoolean(true); dataOutput.write(value.getMonthValue()); dataOutput.write(value.getDayOfMonth()); } }
private Date convertToDate(MonthDay value) { return Date.valueOf(LocalDate.of(2000, value.getMonthValue(), value.getDayOfMonth())); }
public int[] toDatastoreType(MonthDay md) { if (md == null) { return null; } return new int[] {md.getMonthValue(), md.getDayOfMonth()}; }