public Property createProperty(final String name, final ParameterList parameters, final String value) throws IOException, URISyntaxException, ParseException { return new DtStamp(parameters, value); }
/** * @param aList a list of parameters for this component * @param aValue a value string for this component * @throws ParseException where the specified value string is not a valid date-time/date representation */ public DtStamp(final ParameterList aList, final String aValue) throws ParseException { super(DTSTAMP, aList, new Factory()); setValue(aValue); }
/** * Update the DTSTAMP property on a component. * @param date DTSTAMP value to update. If null, the DTSTAMP property * will be removed * @param comp component to update */ public static void setDtStamp(java.util.Date date, Component comp) { DtStamp dtStamp = (DtStamp) comp.getProperties().getProperty(Property.DTSTAMP); if (date == null) { if (dtStamp != null) { comp.getProperties().remove(dtStamp); } return; } if (dtStamp == null) { dtStamp = new DtStamp(); comp.getProperties().add(dtStamp); } dtStamp.getDate().setTime(date.getTime()); }
@Override public int compare(Component o1, Component o2) { int retVal = 0; Sequence defaultSequence = new Sequence(0); Sequence sequence1 = Optional.ofNullable((Sequence) o1.getProperty(Property.SEQUENCE)).orElse(defaultSequence); Sequence sequence2 = Optional.ofNullable((Sequence) o2.getProperty(Property.SEQUENCE)).orElse(defaultSequence); retVal = sequence1.compareTo(sequence2); if (retVal == 0) { DtStamp defaultDtStamp = new DtStamp(new DateTime(0)); DtStamp dtStamp1 = Optional.ofNullable((DtStamp) o1.getProperty(Property.DTSTAMP)).orElse(defaultDtStamp); DtStamp dtStamp2 = Optional.ofNullable((DtStamp) o2.getProperty(Property.DTSTAMP)).orElse(defaultDtStamp); retVal = dtStamp1.compareTo(dtStamp2); } return retVal; } }
prop = new DtStamp(new DateTime(val.getDtstamp())); dts.setDateTime(new DateTime(val.getDtstamp()));
/** * @param aDate a date representing a date-time */ public DtStamp(final DateTime aDate) { super(DTSTAMP, PropertyFactoryImpl.getInstance()); // time must be in UTC.. aDate.setUtc(true); setDate(aDate); }
/** Set the dtstamp, lastmod and created if created is not set already. * @param val */ @NoProxy public void setDtstamps(final Timestamp val) { DateTime dt = new DateTime(val); setDtstamp(new DtStamp(dt).getValue()); setLastmod(new LastModified(dt).getValue()); setCtoken(getLastmod() + "-" + hex4FromNanos(val.getNanos())); if (getCreated() == null) { setCreated(new Created(dt).getValue()); } }
/** * Update the DTSTAMP property on a component. * @param date DTSTAMP value to update. If null, the DTSTAMP property * will be removed * @param comp component to update */ public static void setDtStamp(java.util.Date date, Component comp) { DtStamp dtStamp = (DtStamp) comp.getProperties().getProperty(Property.DTSTAMP); if (date == null) { if (dtStamp != null) { comp.getProperties().remove(dtStamp); } return; } if (dtStamp == null) { dtStamp = new DtStamp(); comp.getProperties().add(dtStamp); } dtStamp.getDate().setTime(date.getTime()); }
@Override public int compare(Component o1, Component o2) { int retVal = 0; Sequence defaultSequence = new Sequence(0); Sequence sequence1 = Optional.ofNullable((Sequence) o1.getProperty(Property.SEQUENCE)).orElse(defaultSequence); Sequence sequence2 = Optional.ofNullable((Sequence) o2.getProperty(Property.SEQUENCE)).orElse(defaultSequence); retVal = sequence1.compareTo(sequence2); if (retVal == 0) { DtStamp defaultDtStamp = new DtStamp(new DateTime(0)); DtStamp dtStamp1 = Optional.ofNullable((DtStamp) o1.getProperty(Property.DTSTAMP)).orElse(defaultDtStamp); DtStamp dtStamp2 = Optional.ofNullable((DtStamp) o2.getProperty(Property.DTSTAMP)).orElse(defaultDtStamp); retVal = dtStamp1.compareTo(dtStamp2); } return retVal; } }
/** * @param aList a list of parameters for this component * @param aDate a date representing a date-time */ public DtStamp(final ParameterList aList, final DateTime aDate) { super(DTSTAMP, aList, new Factory()); // time must be in UTC.. aDate.setUtc(true); setDate(aDate); }
public Property createProperty(final ParameterList parameters, final String value) throws IOException, URISyntaxException, ParseException { return new DtStamp(parameters, value); }
/** * @param aList a list of parameters for this component * @param aDate a date representing a date-time */ public DtStamp(final ParameterList aList, final DateTime aDate) { super(DTSTAMP, aList, PropertyFactoryImpl.getInstance()); // time must be in UTC.. aDate.setUtc(true); setDate(aDate); }
/** * @param aList a list of parameters for this component * @param aValue a value string for this component * @throws ParseException where the specified value string is not a valid date-time/date representation */ public DtStamp(final ParameterList aList, final String aValue) throws ParseException { super(DTSTAMP, aList, new Factory()); setValue(aValue); }
public Property createProperty() { return new DtStamp(); } }