icu::message2::data_model::Expression::Builder Class Reference

The mutable `Expression::Builder` class allows the operator to be constructed incrementally. More...

`#include <messageformat2_data_model.h>`

Inheritance diagram for icu::message2::data_model::Expression::Builder:

## Public Member Functions

Builder & | setOperand (Operand &&rAnd)
| Sets the operand of this expression.
Builder & | setOperator (Operator &&rAtor)
| Sets the operator of this expression.
Builder & | addAttribute (const UnicodeString &key, Operand &&value, UErrorCode &status)
| Adds a single attribute.
Expression | build (UErrorCode &status)
| Constructs a new immutable `Expression` using the operand and operator that were previously set.
| Builder (UErrorCode &status)
| Default constructor.
virtual | ~Builder ()
| Destructor.
| Builder (const Builder &)=delete
Builder & | operator= (const Builder &)=delete
| Builder (Builder &&)=delete
Builder & | operator= (Builder &&)=delete

## Friends

class | Expression

## Detailed Description

The mutable `Expression::Builder` class allows the operator to be constructed incrementally.

Builder is not copyable or movable.

Internal:
  Do not use. This API is for internal use only. ICU 75 technology preview

Deprecated:
  This API is for technology preview only.

Definition at line 1331 of file messageformat2_data_model.h.

## Constructor & Destructor Documentation

## Builder()

icu::message2::data_model::Expression::Builder::Builder | ( | UErrorCode & | status | ) |

Default constructor.

Returns a Builder with no operator or operand set.

Parameters

  status | Input/output error code.

Internal:
  Do not use. This API is for internal use only. ICU 75 technology preview

Deprecated:
  This API is for technology preview only.

## ~Builder()

virtual icu::message2::data_model::Expression::Builder::~Builder | ( |  | ) |

virtual

Destructor.

Internal:
  Do not use. This API is for internal use only. ICU 75 technology preview

Deprecated:
  This API is for technology preview only.

## Member Function Documentation

## addAttribute()

Builder & icu::message2::data_model::Expression::Builder::addAttribute | ( | const UnicodeString & | key,
|  | Operand && | value,
|  | UErrorCode & | status
| ) |  |

Adds a single attribute.

Parameters

  key | The name of the attribute.
  value | The value (right-hand side) of the attribute.
  status | Input/output error code.

Returns
  A reference to the builder.

Internal:
  Do not use. This API is for internal use only. ICU 75 technology preview

Deprecated:
  This API is for technology preview only.

## build()

Expression icu::message2::data_model::Expression::Builder::build | ( | UErrorCode & | status | ) |

Constructs a new immutable `Expression` using the operand and operator that were previously set.

If neither `setOperand()` nor `setOperator()` was previously called, or if `setOperand()` was called with the null operand and `setOperator()` was never called, then `status` is set to U_INVALID_STATE_ERROR.

The builder object (`this`) can still be used after calling `build()`. The `build()` method is non-const for internal implementation reasons, but is observably const.

Parameters

  status | Input/output error code.

Returns
  The new Expression.

Internal:
  Do not use. This API is for internal use only. ICU 75 technology preview

Deprecated:
  This API is for technology preview only.

## setOperand()

Builder & icu::message2::data_model::Expression::Builder::setOperand | ( | Operand && | rAnd | ) |

Sets the operand of this expression.

Parameters

  rAnd | The operand to set. Passed by move.

Returns
  A reference to the builder.

Internal:
  Do not use. This API is for internal use only. ICU 75 technology preview

Deprecated:
  This API is for technology preview only.

## setOperator()

Builder & icu::message2::data_model::Expression::Builder::setOperator | ( | Operator && | rAtor | ) |

Sets the operator of this expression.

Parameters

  rAtor | The operator to set. Passed by move.

Returns
  A reference to the builder.

Internal:
  Do not use. This API is for internal use only. ICU 75 technology preview

Deprecated:
  This API is for technology preview only.

## Friends And Related Symbol Documentation

## Expression

friend class Expression

friend

Definition at line 1333 of file messageformat2_data_model.h.

The documentation for this class was generated from the following file:

- i18n/unicode/messageformat2_data_model.h