@Test public void marshal_should_return_null_for_null_values() { final String formattedDate = cut.marshal(null); assertThat(formattedDate).isNull(); }
@Override public String marshal(Date value) { if (value == null) { return null; } final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_TIME_PATTERN); simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); return simpleDateFormat.format(value); }
RtcDateTimeAdapter extends XmlAdapter<String, Date> { @Override public String marshal(Date value) { if (value == null) { return null; } final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_TIME_PATTERN); simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); return simpleDateFormat.format(value); } }
RtcDateTimeAdapter extends XmlAdapter<String, Date> { @Override public String marshal(Date value) { if (value == null) { return null; } final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_TIME_PATTERN); simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); return simpleDateFormat.format(value); }  }
RtcDateTimeAdapter extends XmlAdapter<String, Date> { @Override public String marshal(Date value) { if (value == null) { return null; } final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_TIME_PATTERN); simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); return simpleDateFormat.format(value); }  @Override Date unmarshal(String value); @Override String marshal(Date value); }
RtcDateTimeAdapter extends XmlAdapter<String, Date> { @Override public String marshal(Date value) { if (value == null) { return null; } final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_TIME_PATTERN); simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); return simpleDateFormat.format(value); }  @Override Date unmarshal(String value); @Override String marshal(Date value);  }