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#

public class ProjectOptions extends ValueRecord implements DeepCloneable<ProjectOptions>

The Project constructor deep-copies the options, so changing this object later has no effect on a project that already exists.

Constructors#

ProjectOptions()#

public ProjectOptions()

Creates options with every field at its default.

Fields#

validation#

public Validation validation = Validation.STRICT;

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 withValidation(Validation value)

Sets validation and returns this instance for chaining.

Parameters

Name Type Description
value Validation The validation mode

Returns - this ProjectOptions.

deepClone#

public ProjectOptions deepClone()

Returns a copy that shares no state with this instance.

Returns - a new ProjectOptions with the same values.

copy#

public ProjectOptions copy()

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 equals(Object other)
public int hashCode()
public String toString()

Inherited from ValueRecord. Two ProjectOptions are equal when their public fields are equal. toString() lists the fields, e.g. ProjectOptions{validation=REPAIR}.

Example#

import org.dhtmlx.plen.*;

public class RepairProject {
  public static void main(String[] args) throws Exception {
    ProjectOptions options = new ProjectOptions().withValidation(Validation.REPAIR);
    Project project = new Project(options);

    System.out.println(options); // ProjectOptions{validation=REPAIR}
  }
}