/** * Immutable constructor. * * @param label label. * @param rel event type. */ public Event(String label, String rel) { super(); setLabel(label); setRel(rel); setImmutable(true); }
/** * Returns the time period description. * * @return time period description */ public When getWhen() { return getExtension(When.class); }
/** * Returns whether it has the label. * * @return whether it has the label */ public boolean hasLabel() { return getLabel() != null; }
/** * Sets the time period description. * * @param when time period description or <code>null</code> to reset */ public void setWhen(When when) { if (when == null) { removeExtension(When.class); } else { setExtension(when); } }
new ExtensionDescription(Email.class, new XmlNamespace("gd", "http://schemas.google.com/g/2005"), "email", false, true, false)); extProfile.declare(BasePersonEntry.class, Event.getDefaultDescription(false, true)); new Event().declareExtensions(extProfile); extProfile.declare(BasePersonEntry.class, new ExtensionDescription(ExtendedProperty.class, new XmlNamespace("gd",
/** * Returns a list containing Event GData extension objects. This method takes a formatted OM Element and * converts it to a list of event objects. * * @param eventsElement The parent element containing the individual elements containing event details. * @return a list containing GData extension Event objects. */ protected final List<Event> getEventsList(final OMElement eventsElement) { List<Event> eventList = new ArrayList<Event>(); Iterator< ? > eventsIterator = eventsElement.getChildElements(); while (eventsIterator.hasNext()) { OMElement singleEventElement = (OMElement) eventsIterator.next(); Event event = new Event(); String eventType = singleEventElement.getLocalName(); if (Event.Rel.ANNIVERSARY.equals(eventType)) { event.setRel(Event.Rel.ANNIVERSARY); } else { event.setRel(Event.Rel.OTHER); } When when = new When(); String dateString = singleEventElement.getText(); when.setStartTime(DateTime.parseDate(dateString)); event.setWhen(when); eventList.add(event); } return eventList; }
/** * Returns whether it has the event type. * * @return whether it has the event type */ public boolean hasRel() { return getRel() != null; }
/** * Returns whether it has the time period description. * * @return whether it has the time period description */ public boolean hasWhen() { return hasExtension(When.class); }
new ExtensionDescription(Email.class, new XmlNamespace("gd", "http://schemas.google.com/g/2005"), "email", false, true, false)); extProfile.declare(BasePersonEntry.class, Event.getDefaultDescription(false, true)); new Event().declareExtensions(extProfile); extProfile.declare(BasePersonEntry.class, new ExtensionDescription(ExtendedProperty.class, new XmlNamespace("gd",
/** * Sets the time period description. * * @param when time period description or <code>null</code> to reset */ public void setWhen(When when) { if (when == null) { removeExtension(When.class); } else { setExtension(when); } }
/** * Returns whether it has the event type. * * @return whether it has the event type */ public boolean hasRel() { return getRel() != null; }
/** * Returns whether it has the time period description. * * @return whether it has the time period description */ public boolean hasWhen() { return hasExtension(When.class); }
/** * Immutable constructor. * * @param label label. * @param rel event type. */ public Event(String label, String rel) { super(); setLabel(label); setRel(rel); setImmutable(true); }
new ExtensionDescription(Email.class, new XmlNamespace("gd", "http://schemas.google.com/g/2005"), "email", false, true, false)); extProfile.declare(BasePersonEntry.class, Event.getDefaultDescription(false, true)); new Event().declareExtensions(extProfile); extProfile.declare(BasePersonEntry.class, new ExtensionDescription(ExtendedProperty.class, new XmlNamespace("gd",
/** * Sets the time period description. * * @param when time period description or <code>null</code> to reset */ public void setWhen(When when) { if (when == null) { removeExtension(When.class); } else { setExtension(when); } }
/** * Returns whether it has the label. * * @return whether it has the label */ public boolean hasLabel() { return getLabel() != null; }
/** * Returns whether it has the event type. * * @return whether it has the event type */ public boolean hasRel() { return getRel() != null; }
/** * Returns whether it has the time period description. * * @return whether it has the time period description */ public boolean hasWhen() { return hasExtension(When.class); }
/** * Returns the time period description. * * @return time period description */ public When getWhen() { return getExtension(When.class); }
/** * Immutable constructor. * * @param label label. * @param rel event type. */ public Event(String label, String rel) { super(); setLabel(label); setRel(rel); setImmutable(true); }