Skip to content

FnIf

Returns one value if the specified condition evaluates to true and another value if the specified condition evaluates to false.

Initializers

import ros_cdk_core
ros_cdk_core.FnIf(
  condition: typing.Union[str, IRosConditionExpression],
  value_if_true: typing.Any,
  value_if_false: typing.Any
)
Name Type Description
condition typing.Union[str, IRosConditionExpression] A reference to a condition in the Conditions section.
value_if_true typing.Any A value to be returned if the specified condition evaluates to true.
value_if_false typing.Any A value to be returned if the specified condition evaluates to false.

conditionRequired

A reference to a condition in the Conditions section.

Use the condition's name to reference it.


value_if_trueRequired

  • Type: typing.Any

A value to be returned if the specified condition evaluates to true.


value_if_falseRequired

  • Type: typing.Any

A value to be returned if the specified condition evaluates to false.


Methods

Name Description
resolve Produce the Token's value at resolution time.
to_jso_n Turn this Token into JSON.
to_string Convert an instance of this Token to a string.

resolve

def resolve(
  _context: IResolveContext
) -> typing.Any

Produce the Token's value at resolution time.

_contextRequired


to_jso_n

def to_jso_n() -> typing.Any

Turn this Token into JSON.

Called automatically when JSON.stringify() is called on a Token.

to_string

def to_string() -> str

Convert an instance of this Token to a string.

This method will be called implicitly by language runtimes if the object is embedded into a string. We treat it the same as an explicit stringification.

Properties

Name Type Description
creation_stack typing.List[str] The captured stack trace which represents the location in which this token was created.

creation_stackRequired

creation_stack: typing.List[str]
  • Type: typing.List[str]

The captured stack trace which represents the location in which this token was created.