@Override public ValidationErrors validate(final StandaloneCatalog catalog, final ValidationErrors errors) { if (planName == null) { errors.add(new ValidationError(String.format("Invalid plan for phase '%s'", type), DefaultPlanPhase.class, "")); } if (fixed == null && recurring == null && usages.length == 0) { errors.add(new ValidationError(String.format("Phase %s of plan %s need to define at least either a fixed or recurrring or usage section.", type.toString(), planName), DefaultPlanPhase.class, type.toString())); } if (fixed != null) { fixed.validate(catalog, errors); } if (recurring != null) { recurring.validate(catalog, errors); } duration.validate(catalog, errors); validateCollection(catalog, errors, usages); return errors; }
@Override public ValidationErrors validate(final StandaloneCatalog catalog, final ValidationErrors errors) { if (planName == null) { errors.add(new ValidationError(String.format("Invalid plan for phase '%s'", type), DefaultPlanPhase.class, "")); } if (fixed == null && recurring == null && usages.length == 0) { errors.add(new ValidationError(String.format("Phase %s of plan %s need to define at least either a fixed or recurrring or usage section.", type.toString(), planName), DefaultPlanPhase.class, type.toString())); } if (fixed != null) { fixed.validate(catalog, errors); } if (recurring != null) { recurring.validate(catalog, errors); } duration.validate(catalog, errors); validateCollection(catalog, errors, usages); return errors; }