/** * {@inheritDoc} */ public int hashCode() { return new HashCodeBuilder().append(getName()).append(getProperties()) .append(getVotes()).toHashCode(); }
/** * @return the optional voter property */ public final Voter getVoter() { return (Voter) getProperty(Property.VOTER); }
@Override public VVoter createComponent() { return new VVoter(); }
/** * {@inheritDoc} */ public final String toString() { final StringBuffer b = new StringBuffer(); b.append(BEGIN); b.append(':'); b.append(getName()); b.append(Strings.LINE_SEPARATOR); b.append(getProperties()); b.append(votes); b.append(END); b.append(':'); b.append(getName()); b.append(Strings.LINE_SEPARATOR); return b.toString(); }
/** * {@inheritDoc} */ public boolean equals(final Object arg0) { if (arg0 instanceof VVoter) { return super.equals(arg0) && ObjectUtils.equals(votes, ((VVoter) arg0) .getVotes()); } return super.equals(arg0); }
/** * {@inheritDoc} */ public final void validate(final boolean recurse) throws ValidationException { /* * ; 'last-mod' and 'voter' are optional, but MUST NOT occur more than once */ PropertyValidator.getInstance().assertOneOrLess(Property.LAST_MODIFIED, getProperties()); PropertyValidator.getInstance().assertOneOrLess(Property.VOTER, getProperties()); /* * ; the following is optional, ; and MAY occur more than once x-prop */ if (recurse) { validateProperties(); } }
voter.validate(Method.CONFIRM);
/** * {@inheritDoc} */ public boolean equals(final Object arg0) { if (arg0 instanceof VVoter) { return super.equals(arg0) && ObjectUtils.equals(votes, ((VVoter) arg0) .getVotes()); } return super.equals(arg0); }
/** * {@inheritDoc} */ public final void validate(final boolean recurse) throws ValidationException { /* Dtstamp and Voter are required once only */ PropertyValidator.getInstance().assertOne(Property.DTSTAMP, getProperties()); PropertyValidator.getInstance().assertOne(Property.VOTER, getProperties()); /* * ; 'last-mod' and '?' are optional, but MUST NOT occur more than once */ PropertyValidator.getInstance().assertOneOrLess(Property.LAST_MODIFIED, getProperties()); /* * ; the following is optional, ; and MAY occur more than once x-prop */ if (recurse) { validateProperties(); } }
/** * {@inheritDoc} */ public final String toString() { final StringBuffer b = new StringBuffer(); b.append(BEGIN); b.append(':'); b.append(getName()); b.append(Strings.LINE_SEPARATOR); b.append(getProperties()); b.append(votes); b.append(END); b.append(':'); b.append(getName()); b.append(Strings.LINE_SEPARATOR); return b.toString(); }
((VVoter)component).validate(recurse); continue;
/** * {@inheritDoc} */ public int hashCode() { return new HashCodeBuilder().append(getName()).append(getProperties()) .append(getVotes()).toHashCode(); }
cl = ((VPoll)comp).getVoters(); } else if (comp instanceof VVoter) { cl = ((VVoter)comp).getVotes();
/** * @return the optional voter property */ public final Voter getVoter() { return (Voter) getProperty(Property.VOTER); }
@Override public VVoter createComponent(PropertyList properties) { return new VVoter(properties); }
((VVoter)component).validate(recurse); continue;
((VVoter) component).getVotes().add(subComponent);
/** * @return the optional last-modified property */ public final LastModified getLastModified() { return (LastModified) getProperty(Property.LAST_MODIFIED); }
/** * Creates a component which contains sub-components. * * @param name name of the component * @param properties a list of component properties * @param components a list of sub-components (namely standard/daylight timezones) * @return a component */ public Component createComponent(final String name, final PropertyList properties, final ComponentList components) { if (components != null) { Component component = null; if (Component.VTIMEZONE.equals(name)) { component = new VTimeZone(properties, components); } else if (Component.VEVENT.equals(name)) { component = new VEvent(properties, components); } else if (Component.VVOTER.equals(name)) { component = new VVoter(properties, components); } else { throw new IllegalArgumentException("Illegal component [" + name + "]"); } return component; } return createComponent(name, properties); }
voter.validate(Method.CONFIRM);