/** * Convenience method for retrieving a named property. * @param name name of the property to retrieve * @return the first matching property in the property list with the specified name */ public final <T extends Property> T getProperty(final String name) { return getProperties().getProperty(name); }
/** * {@inheritDoc} */ public final boolean equals(final Object arg0) { if (arg0 instanceof Calendar) { final Calendar calendar = (Calendar) arg0; return new EqualsBuilder().append(getProperties(), calendar.getProperties()) .append(getComponents(), calendar.getComponents()).isEquals(); } return super.equals(arg0); }
/** * Convenience method for retrieving a list of named properties. * @param name name of properties to retrieve * @return a property list containing only properties with the specified name */ public final PropertyList<Property> getProperties(final String name) { return getProperties().getProperties(name); }
/** * Invoke validation on the calendar properties in its current state. * @throws ValidationException where any of the calendar properties is not in a valid state */ private void validateProperties() throws ValidationException { for (final Property property : getProperties()) { property.validate(); } }
/** * {@inheritDoc} */ public final int hashCode() { return new HashCodeBuilder().append(getProperties()).append( getComponents()).toHashCode(); } }
/** * {@inheritDoc} */ public final boolean equals(final Object arg0) { if (arg0 instanceof Calendar) { final Calendar calendar = (Calendar) arg0; return new EqualsBuilder().append(getProperties(), calendar.getProperties()) .append(getComponents(), calendar.getComponents()).isEquals(); } return super.equals(arg0); }
/** * {@inheritDoc} */ public final int hashCode() { return new HashCodeBuilder().append(getProperties()).append( getComponents()).toHashCode(); } }
/** * {@inheritDoc} */ public final boolean equals(final Object arg0) { if (arg0 instanceof Calendar) { final Calendar calendar = (Calendar) arg0; return new EqualsBuilder().append(getProperties(), calendar.getProperties()) .append(getComponents(), calendar.getComponents()).isEquals(); } return super.equals(arg0); }
/** * {@inheritDoc} */ public final int hashCode() { return new HashCodeBuilder().append(getProperties()).append( getComponents()).toHashCode(); } }
/** * Convenience method for retrieving a named property. * @param name name of the property to retrieve * @return the first matching property in the property list with the specified name */ public final Property getProperty(final String name) { return getProperties().getProperty(name); }
/** * {@inheritDoc} */ public final int hashCode() { return new HashCodeBuilder().append(getProperties()).append( getComponents()).toHashCode(); }
/** * Convenience method for retrieving a named property. * @param name name of the property to retrieve * @return the first matching property in the property list with the specified name */ public final Property getProperty(final String name) { return getProperties().getProperty(name); }
/** * Create a base Calendar containing no components. * @return base Calendar */ public static Calendar createBaseCalendar() { Calendar cal = new Calendar(); cal.getProperties().add(new ProdId(CosmoConstants.PRODUCT_ID)); cal.getProperties().add(Version.VERSION_2_0); cal.getProperties().add(CalScale.GREGORIAN); return cal; }
@SafeVarargs protected final Calendar wrap(Method method, T... component) { Calendar calendar = Calendars.wrap(component); calendar.getProperties().add(prodId); calendar.getProperties().add(Version.VERSION_2_0); return transform(method, calendar); }
@SafeVarargs protected final Calendar wrap(Method method, T... component) { Calendar calendar = Calendars.wrap(component); calendar.getProperties().add(prodId); calendar.getProperties().add(Version.VERSION_2_0); return transform(method, calendar); }
/** * Creates a deep copy of the specified calendar. * @param c the calendar to copy * @throws IOException where an error occurs reading calendar data * @throws ParseException where calendar parsing fails * @throws URISyntaxException where an invalid URI string is encountered */ public Calendar(Calendar c) throws ParseException, IOException, URISyntaxException { this(new PropertyList<Property>(c.getProperties()), new ComponentList<CalendarComponent>(c.getComponents())); }
/** * Creates a deep copy of the specified calendar. * @param c the calendar to copy * @throws IOException where an error occurs reading calendar data * @throws ParseException where calendar parsing fails * @throws URISyntaxException where an invalid URI string is encountered */ public Calendar(Calendar c) throws ParseException, IOException, URISyntaxException { this(new PropertyList<Property>(c.getProperties()), new ComponentList<CalendarComponent>(c.getComponents())); }
/** * Creates a deep copy of the specified calendar. * @param c the calendar to copy * @throws IOException where an error occurs reading calendar data * @throws ParseException where calendar parsing fails * @throws URISyntaxException where an invalid URI string is encountered */ public Calendar(Calendar c) throws ParseException, IOException, URISyntaxException { this(new PropertyList(c.getProperties()), new ComponentList<CalendarComponent>(c.getComponents())); }
/** * Creates a deep copy of the specified calendar. * @param c the calendar to copy * @throws IOException where an error occurs reading calendar data * @throws ParseException where calendar parsing fails * @throws URISyntaxException where an invalid URI string is encountered */ public Calendar(Calendar c) throws ParseException, IOException, URISyntaxException { this(new PropertyList(c.getProperties()), new ComponentList(c .getComponents())); }
@Before public void setUp() { calendar = new Calendar(); calendar.getProperties().add(new ProdId("-//Ben Fortuna//iCal4j 1.0//EN")); calendar.getProperties().add(Version.VERSION_2_0); calendar.getProperties().add(CalScale.GREGORIAN); VEvent vEvent = new VEvent(); vEvent.getProperties().add(new Uid("1")); calendar.getComponents().add(vEvent); }