/** * {@inheritDoc} */ public final void validate(final boolean recurse) throws ValidationException { /* * ; 'uiid' is required, but MUST NOT occur more ; than once uiid / */ PropertyValidator.getInstance().assertOne(Property.UID, getProperties()); /* * ; the following are optional, * ; but MUST NOT occur more than once * * name / description / street-address / extended-address / * locality / region / country / postal-code / tzid / geo / * location-type / categories / * dtstamp / created / last-modified */ Arrays.asList(Property.NAME, Property.DESCRIPTION, Property.STREET_ADDRESS, Property.EXTENDED_ADDRESS, Property.LOCALITY, Property.REGION, Property.COUNTRY, Property.POSTALCODE, Property.TZID, Property.GEO, Property.LOCATION_TYPE, Property.CATEGORIES, Property.DTSTAMP, Property.CREATED, Property.LAST_MODIFIED).forEach(property -> PropertyValidator.getInstance().assertOneOrLess(property, getProperties())); /* * ; the following is optional, ; and MAY occur more than once tel / url / x-prop */ if (recurse) { validateProperties(); } }
/** * {@inheritDoc} */ public final void validate(final boolean recurse) throws ValidationException { /* * ; 'uiid' is required, but MUST NOT occur more ; than once uiid / */ PropertyValidator.getInstance().assertOne(Property.UID, getProperties()); /* * ; the following are optional, * ; but MUST NOT occur more than once * * name / description / street-address / extended-address / * locality / region / country / postal-code / tzid / geo / * location-type / categories / * dtstamp / created / last-modified */ Arrays.asList(Property.NAME, Property.DESCRIPTION, Property.STREET_ADDRESS, Property.EXTENDED_ADDRESS, Property.LOCALITY, Property.REGION, Property.COUNTRY, Property.POSTALCODE, Property.TZID, Property.GEO, Property.LOCATION_TYPE, Property.CATEGORIES, Property.DTSTAMP, Property.CREATED, Property.LAST_MODIFIED).forEach(property -> PropertyValidator.getInstance().assertOneOrLess(property, getProperties())); /* * ; the following is optional, ; and MAY occur more than once tel / url / x-prop */ if (recurse) { validateProperties(); } }