# Interface LifecyclePolicyOrBuilder (0.16.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [0.16.0 (latest)](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.batch.v1.LifecyclePolicyOrBuilder)
- [0.15.0](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.batch.v1.LifecyclePolicyOrBuilder)
- [0.14.1](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.batch.v1.LifecyclePolicyOrBuilder)

    public interface LifecyclePolicyOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### getAction()

    public abstract LifecyclePolicy.Action getAction()

Action to execute when ActionCondition is true.
When RETRY_TASK is specified, we will retry failed tasks
if we notice any exit code match and fail tasks if no match is found.
Likewise, when FAIL_TASK is specified, we will fail tasks
if we notice any exit code match and retry tasks if no match is found.

`.google.events.cloud.batch.v1.LifecyclePolicy.Action action = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.batch.v1.LifecyclePolicy.Action` | The action. |

### getActionCondition()

    public abstract LifecyclePolicy.ActionCondition getActionCondition()

Conditions that decide why a task failure is dealt with a specific action.

`.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition` | The actionCondition. |

### getActionConditionOrBuilder()

    public abstract LifecyclePolicy.ActionConditionOrBuilder getActionConditionOrBuilder()

Conditions that decide why a task failure is dealt with a specific action.

`.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.batch.v1.LifecyclePolicy.ActionConditionOrBuilder` |   |

### getActionValue()

    public abstract int getActionValue()

Action to execute when ActionCondition is true.
When RETRY_TASK is specified, we will retry failed tasks
if we notice any exit code match and fail tasks if no match is found.
Likewise, when FAIL_TASK is specified, we will fail tasks
if we notice any exit code match and retry tasks if no match is found.

`.google.events.cloud.batch.v1.LifecyclePolicy.Action action = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for action. |

### hasActionCondition()

    public abstract boolean hasActionCondition()

Conditions that decide why a task failure is dealt with a specific action.

`.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the actionCondition field is set. |