> ## Documentation Index
> Fetch the complete documentation index at: https://cdktn.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Java: Precondition

> CDKTN Core API Reference for Precondition in Java.

Terraform checks a precondition before evaluating the object it is associated with.

## Initializer <a name="Initializer" id="cdktn.Precondition.Initializer" />

```java theme={null}
import io.cdktn.cdktn.Precondition;

Precondition.builder()
    .condition(java.lang.Object)
    .errorMessage(java.lang.String)
    .build();
```

## Properties <a name="Properties" id="Properties" />

| **Name**                                                                          | **Type**                      | **Description**                                                                                                                    |
| --------------------------------------------------------------------------------- | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| <code><a href="#cdktn.Precondition.property.condition">condition</a></code>       | <code>java.lang.Object</code> | This is a boolean expression that should return true if the intended assumption or guarantee is fulfilled or false if it does not. |
| <code><a href="#cdktn.Precondition.property.errorMessage">errorMessage</a></code> | <code>java.lang.String</code> | This contains the text that Terraform will include as part of error messages when it detects an unmet condition.                   |

***

### `condition`<sup>Required</sup> <a name="condition" id="cdktn.Precondition.property.condition" />

```java theme={null}
public java.lang.Object getCondition();
```

* *Type:* java.lang.Object

This is a boolean expression that should return true if the intended assumption or guarantee is fulfilled or false if it does not.

***

### `errorMessage`<sup>Required</sup> <a name="errorMessage" id="cdktn.Precondition.property.errorMessage" />

```java theme={null}
public java.lang.String getErrorMessage();
```

* *Type:* java.lang.String

This contains the text that Terraform will include as part of error messages when it detects an unmet condition.

***
