# SagaOption.Builder (dapr-sdk-workflows 0.12.2 API)
declaration: package: io.dapr.workflows.saga, class: SagaOption, class: Builder

Package io.dapr.workflows.saga

# Class SagaOption.Builder

java.lang.Object
io.dapr.workflows.saga.SagaOption.Builder

Enclosing class:
  SagaOption

public static final class SagaOption.Builder extends Object

## Constructor Summary

Constructors
Constructor
Description
`Builder()`

## Method Summary

Modifier and Type
Method
Description
`SagaOption`
`build()`
Build Saga optiion.
`SagaOption.Builder`
`setContinueWithError(boolean continueWithError)`
Set continue with error.
`SagaOption.Builder`
`setMaxParallelThread(int maxParallelThread)`
set max parallel thread.
`SagaOption.Builder`
`setParallelCompensation(boolean parallelCompensation)`
Set parallel compensation.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Builder

public Builder()

## Method Details

### setParallelCompensation

public SagaOption.Builder setParallelCompensation(boolean parallelCompensation)
Set parallel compensation.

Parameters:
  `parallelCompensation` - parallel compensation or not
Returns:
  this builder itself

### setMaxParallelThread

public SagaOption.Builder setMaxParallelThread(int maxParallelThread)
set max parallel thread.

Only valid when parallelCompensation is true.

Parameters:
  `maxParallelThread` - max parallel thread
Returns:
  this builder itself

### setContinueWithError

public SagaOption.Builder setContinueWithError(boolean continueWithError)
Set continue with error.

Only valid when parallelCompensation is false.

Parameters:
  `continueWithError` - continue with error or not
Returns:
  this builder itself

### build

public SagaOption build()
Build Saga optiion.

Returns:
  Saga optiion