ProjectOptions#
Options for a new Project. Create one with new ProjectOptions(), set fields with the fluent withX setters, and pass it to the Project constructor. Passing null to the constructor gives the defaults.
Declaration#
The Project constructor deep-copies the options, so changing this object later has no effect on a project that already exists.
Constructors#
ProjectOptions()#
public
Creates options with every field at its default.
Fields#
validation#
public Validation validation ;
How the project treats invalid input data. Default: Validation.STRICT.
| Value | Effect |
|---|---|
Validation.STRICT |
Invalid data throws an InputException with the path of the bad field. |
Validation.REPAIR |
Fixable data is repaired, and each fix is reported as a Note.Repaired entry in ScheduleResult.notes. |
See Validation for what repair changes.
Methods#
withValidation#
public ProjectOptions
Sets validation and returns this instance for chaining.
Parameters
| Name | Type | Description |
|---|---|---|
value |
Validation |
The validation mode |
Returns - this ProjectOptions.
deepClone#
public ProjectOptions
Returns a copy that shares no state with this instance.
Returns - a new ProjectOptions with the same values.
copy#
public ProjectOptions
Returns a shallow copy. ProjectOptions holds only an enum field, so the result is the same as deepClone().
Returns - a new ProjectOptions with the same values.
equals, hashCode, toString#
public boolean
public int
public String
Inherited from ValueRecord. Two ProjectOptions are equal when their public fields are equal. toString() lists the fields, e.g. ProjectOptions{validation=REPAIR}.
Example#
;
Related#
Project- the constructor that takes itValidation- strict or repair validationInputException- what strict validation throws- Accept messy input - turning on repair validation
- Repair instead of reject - repair notes as the alternative to errors