public PropertyBuilder parameter(Parameter parameter) { parameters.add(parameter); return this; }
private static Property uidProp(final Property prop, final String uid) { Parameter par = new XParameter(BwXproperty.xparUid, uid); prop.getParameters().add(par); return prop; }
private static Property langProp(final Property prop, final BwStringBase s) { Parameter par = s.getLangPar(); if (par != null) { prop.getParameters().add(par); } return prop; }
/** * Replace any parameters of the same type with the one specified. * @param parameter parameter to add to this list in place of all others with the same name * @return true if successfully added to this list */ public final boolean replace(final Parameter parameter) { for (final Iterator<Parameter> i = getParameters(parameter.getName()).iterator(); i.hasNext();) { remove(i.next()); } return add(parameter); }
/** * Replace any parameters of the same type with the one specified. * @param parameter parameter to add to this list in place of all others with the same name * @return true if successfully added to this list */ public final boolean replace(final Parameter parameter) { for (final Iterator i = getParameters(parameter.getName()).iterator(); i.hasNext();) { remove((Parameter) i.next()); } return add(parameter); }
/** * Replace any parameters of the same type with the one specified. * @param parameter parameter to add to this list in place of all others with the same name * @return true if successfully added to this list */ public final boolean replace(final Parameter parameter) { for (final Iterator<Parameter> i = getParameters(parameter.getName()).iterator(); i.hasNext();) { remove(i.next()); } return add(parameter); }
/** * Replace any parameters of the same type with the one specified. * @param parameter parameter to add to this list in place of all others with the same name * @return true if successfully added to this list */ public final boolean replace(final Parameter parameter) { for (Parameter parameter1 : getParameters(parameter.getName())) { remove(parameter1); } return add(parameter); }
protected static void replaceParameter(ParameterList parameterList, Parameter parameter) { if (parameter == null) { return; } Parameter existingParam = parameterList.getParameter(parameter.getName()); if (existingParam != null) { parameterList.remove(existingParam); } parameterList.add(parameter); }
private static void correctTzParameter(Property property, String newTimezoneId) { property.getParameters().removeAll(Parameter.TZID); if (newTimezoneId != null) { property.getParameters().add(new TzId(newTimezoneId)); } }
public final void test3() { java.util.Calendar cal = getCalendarInstance(); // tomorrow.. cal.add(java.util.Calendar.DAY_OF_MONTH, 1); cal.set(java.util.Calendar.HOUR_OF_DAY, 9); cal.set(java.util.Calendar.MINUTE, 30); VEvent meeting = new VEvent(new DateTime(cal.getTime().getTime()), java.time.Duration.ofHours(1), "Progress Meeting"); // add timezone information.. meeting.getProperty(Property.DTSTART).getParameters().add(tzParam); log.info(meeting.toString()); }
public final void test2() { java.util.Calendar cal = getCalendarInstance(); cal.set(java.util.Calendar.MONTH, java.util.Calendar.DECEMBER); cal.set(java.util.Calendar.DAY_OF_MONTH, 25); VEvent christmas = new VEvent(new Date(cal.getTime()), "Christmas Day"); // initialise as an all-day event.. christmas.getProperty(Property.DTSTART).getParameters().add(Value.DATE); // add timezone information.. christmas.getProperty(Property.DTSTART).getParameters().add(tzParam); log.info(christmas.toString()); }
/** * Test non-utc timezone works. */ public void testNonUtcTimezone() throws ParseException { DtStart start = new DtStart(); start.getParameters().add(Value.DATE_TIME); start.getParameters().add(new TzId("GMT")); start.setValue("20070101T080000"); assertEquals("DTSTART;VALUE=DATE-TIME;TZID=GMT:20070101T080000" + Strings.LINE_SEPARATOR, start.toString()); } }
@Test public void shouldLeaveAttendeeAsItIs() throws URISyntaxException { Attendee attendee = new Attendee("mailto:mobile-media-applications@1und1.de"); attendee.getParameters().add(new Cn("Mobile Media")); RuleManager.applyTo(attendee); assertEquals("mailto:mobile-media-applications@1und1.de", attendee.getValue()); }
/** * Test deep copy of properties. */ public void testCopy() throws IOException, URISyntaxException, ParseException { Property copy = property.copy(); assertEquals(property, copy); copy.getParameters().add(Value.BOOLEAN); assertFalse(property.equals(copy)); assertFalse(copy.equals(property)); }
@Test public void shouldCorrectlyRemoveApostrophes() throws URISyntaxException { Attendee attendee = new Attendee("mailto:'mobile-media-applications@1und1.de'"); attendee.getParameters().add(new Cn("Mobile Media")); RuleManager.applyTo(attendee); assertEquals("mailto:mobile-media-applications@1und1.de", attendee.getValue()); }
/** * Unit test on a date-time trigger. */ public void testTriggerDateTime() throws ValidationException { assertNull(trigger.getDuration()); assertNotNull(trigger.getDate()); assertNotNull(trigger.getDateTime()); trigger.validate(); trigger.getParameters().add(Value.DURATION); assertValidationException(trigger); }