@Test public void testEncodeFraction() { Date a = new Date(1); Date b = new Date(125); Date c = new Date(100); assertEquals("1970-01-01T00:00:00.001Z", encodeDate(a, Precision.Fraction).getValue()); assertEquals("1970-01-01T00:00:00.125Z", encodeDate(b, Precision.Fraction).getValue()); assertEquals("1970-01-01T00:00:00.100Z", encodeDate(c, Precision.Fraction).getValue()); }
public static DublinCoreValue encodeDate(Date date, Precision precision) { if (date == null) throw new IllegalArgumentException("The date must not be null"); if (precision == null) throw new IllegalArgumentException("The precision must not be null"); return DublinCoreValue.mk(formatDate(date, precision), DublinCore.LANGUAGE_UNDEFINED, Opt.some(DublinCore.ENC_SCHEME_W3CDTF)); }
EncodingSchemeUtils { public static DublinCoreValue encodeDate(Date date, Precision precision) { if (date == null) throw new IllegalArgumentException("The date must not be null"); if (precision == null) throw new IllegalArgumentException("The precision must not be null"); return DublinCoreValue.mk(formatDate(date, precision), DublinCore.LANGUAGE_UNDEFINED, Opt.some(DublinCore.ENC_SCHEME_W3CDTF)); } }
EncodingSchemeUtils { public static DublinCoreValue encodeDate(Date date, Precision precision) { if (date == null) throw new IllegalArgumentException("The date must not be null"); if (precision == null) throw new IllegalArgumentException("The precision must not be null"); return DublinCoreValue.mk(formatDate(date, precision), DublinCore.LANGUAGE_UNDEFINED, Opt.some(DublinCore.ENC_SCHEME_W3CDTF)); } private  EncodingSchemeUtils(); }
EncodingSchemeUtils { public static DublinCoreValue encodeDate(Date date, Precision precision) { if (date == null) throw new IllegalArgumentException("The date must not be null"); if (precision == null) throw new IllegalArgumentException("The precision must not be null"); return DublinCoreValue.mk(formatDate(date, precision), DublinCore.LANGUAGE_UNDEFINED, Opt.some(DublinCore.ENC_SCHEME_W3CDTF)); } private  EncodingSchemeUtils(); static DublinCoreValue encodeDate(Date date, Precision precision); static String formatDate(Date date, Precision precision); static DublinCoreValue encodePeriod(DCMIPeriod period, Precision precision); static DublinCoreValue encodeDuration(long duration); static Long decodeDuration(String value); static Long decodeDuration(DublinCoreValue value); static Long decodeMandatoryDuration(String value); static Date decodeDate(DublinCoreValue value); static Date decodeDate(String value); static Date decodeMandatoryDate(DublinCoreValue value); static Date decodeMandatoryDate(String value); static DCMIPeriod decodePeriod(DublinCoreValue value); static DCMIPeriod decodePeriod(String value); static DCMIPeriod decodeMandatoryPeriod(DublinCoreValue value); static DCMIPeriod decodeMandatoryPeriod(String value); static Temporal decodeTemporal(DublinCoreValue value); static Temporal decodeMandatoryTemporal(DublinCoreValue value); }
EncodingSchemeUtils { public static DublinCoreValue encodeDate(Date date, Precision precision) { if (date == null) throw new IllegalArgumentException("The date must not be null"); if (precision == null) throw new IllegalArgumentException("The precision must not be null"); return DublinCoreValue.mk(formatDate(date, precision), DublinCore.LANGUAGE_UNDEFINED, Opt.some(DublinCore.ENC_SCHEME_W3CDTF)); } private  EncodingSchemeUtils(); static DublinCoreValue encodeDate(Date date, Precision precision); static String formatDate(Date date, Precision precision); static DublinCoreValue encodePeriod(DCMIPeriod period, Precision precision); static DublinCoreValue encodeDuration(long duration); static Long decodeDuration(String value); static Long decodeDuration(DublinCoreValue value); static Long decodeMandatoryDuration(String value); static Date decodeDate(DublinCoreValue value); static Date decodeDate(String value); static Date decodeMandatoryDate(DublinCoreValue value); static Date decodeMandatoryDate(String value); static DCMIPeriod decodePeriod(DublinCoreValue value); static DCMIPeriod decodePeriod(String value); static DCMIPeriod decodeMandatoryPeriod(DublinCoreValue value); static DCMIPeriod decodeMandatoryPeriod(String value); static Temporal decodeTemporal(DublinCoreValue value); static Temporal decodeMandatoryTemporal(DublinCoreValue value);  }