IfChain

class IfChain : Node


An intermediary builder type used while building an IfFlow.

IfChain represents a conditional structure consisting of an initial ifThen clause and optional elseIfThens. It does not include an elseThen clause. An IfChain can be converted into a complete IfFlow by adding an orElse clause via its extension function.

If the condition of the primary ifThen is true, its associated node is executed. Otherwise, the elseIfThens are evaluated in order. If any IfThen condition in elseIfThens is true, its associated node is executed, and subsequent conditions are skipped. If no condition is met, execution continues to the Node following this IfChain in the parent SequentialFlow.

Summary

Public constructors

IfChain(ifThen: IfThen, elseIfThens: List<IfThen>)

Create an IfChain instance.

Public properties

List<IfThen>

Subsequent conditional clauses in the IfChain.

IfThen

The primary IfThen in the IfChain.

Inherited properties

From com.google.home.automation.Node
String?

String identifier of this node.

Public constructors

IfChain

IfChain(ifThen: IfThen, elseIfThens: List<IfThen> = emptyList())

Create an IfChain instance.

Parameters
ifThen: IfThen

The first IfThen clause of the IfChain.

elseIfThens: List<IfThen> = emptyList()

Subsequent conditional clauses in the IfChain.

Public properties

elseIfThens

val elseIfThensList<IfThen>

Subsequent conditional clauses in the IfChain. These will execute in order if the first IfThen is false. If any IfThen condition is true, its associated node is executed, and the rest of the conditions are not evaluated.

ifThen

val ifThenIfThen

The primary IfThen in the IfChain.