[Canonical page](<https://docs.dhtmlx.com/planning-engine/java/api/project/project-options/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# ProjectOptions

Options for a new [`Project`](<https://docs.dhtmlx.com/planning-engine/java/api/project/project.md>). 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

```java
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()

```java
public ProjectOptions()
```

Creates options with every field at its default.

## Fields

### validation

```java
public Validation validation = Validation.STRICT;
```

How the project treats invalid input data. Default: [`Validation.STRICT`](<https://docs.dhtmlx.com/planning-engine/java/api/project/validation.md>).

| Value | Effect |
|---|---|
| `Validation.STRICT` | Invalid data throws an [`InputException`](<https://docs.dhtmlx.com/planning-engine/java/api/errors/input-exception.md>) with the path of the bad field. |
| `Validation.REPAIR` | Fixable data is repaired, and each fix is reported as a [`Note.Repaired`](<https://docs.dhtmlx.com/planning-engine/java/api/results/note.md>) entry in [`ScheduleResult.notes`](<https://docs.dhtmlx.com/planning-engine/java/api/results/schedule-result.md>). |

See [`Validation`](<https://docs.dhtmlx.com/planning-engine/java/api/project/validation.md>) for what repair changes.

## Methods

### withValidation

```java
public ProjectOptions withValidation(Validation value)
```

Sets `validation` and returns this instance for chaining.

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | [`Validation`](<https://docs.dhtmlx.com/planning-engine/java/api/project/validation.md>) | The validation mode |

**Returns** - this `ProjectOptions`.

### deepClone

```java
public ProjectOptions deepClone()
```

Returns a copy that shares no state with this instance.

**Returns** - a new `ProjectOptions` with the same values.

### copy

```java
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

```java
public boolean equals(Object other)
public int hashCode()
public String toString()
```

Inherited from [`ValueRecord`](<https://docs.dhtmlx.com/planning-engine/java/api/support/value-record.md>). Two `ProjectOptions` are equal when their public fields are equal. `toString()` lists the fields, e.g. `ProjectOptions{validation=REPAIR}`.

## Example

```java
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}
  }
}
```

## Related

- [`Project`](<https://docs.dhtmlx.com/planning-engine/java/api/project/project.md>) - the constructor that takes it
- [`Validation`](<https://docs.dhtmlx.com/planning-engine/java/api/project/validation.md>) - strict or repair validation
- [`InputException`](<https://docs.dhtmlx.com/planning-engine/java/api/errors/input-exception.md>) - what strict validation throws
- [Accept messy input](<https://docs.dhtmlx.com/planning-engine/java/how-to/accept-messy-input.md>) - turning on repair validation
- [Repair instead of reject](<https://docs.dhtmlx.com/planning-engine/java/error-handling.md#repair-instead-of-reject>) - repair notes as the alternative to errors
