PropertyValidation propertyValidation = this.validateForValue((T) updateValue); return !propertyValidation.hasErrors();
/** * Validates the update value against the property and if validation passes returns the * {@link AbstractPropertyUpdate} object. * * @param updateValue * Update value * @return {@link AbstractPropertyUpdate} * @throws PropertyValidationException * If validation fails. */ public AbstractPropertyUpdate<T> createAndValidatePropertyUpdate(T updateValue) throws PropertyValidationException { if (getValue().equals(updateValue)) { throw new PropertyValidationException("Update value for creating property update can not be same as current property value."); } PropertyValidation propertyValidation = this.validateForValue(updateValue); // if has errors raise exception, otherwise create property update if (propertyValidation.hasErrors()) { throw new PropertyValidationException(propertyValidation); } else { return this.createPropertyUpdate(updateValue); } }