ICU 77.1
77.1
|
The mutable Expression::Builder
class allows the operator to be constructed incrementally.
More...
#include <messageformat2_data_model.h>
Public Member Functions | |
Builder & | setOperand (Operand &&rAnd) |
Sets the operand of this expression. More... | |
Builder & | setOperator (Operator &&rAtor) |
Sets the operator of this expression. More... | |
Builder & | addAttribute (const UnicodeString &key, Operand &&value, UErrorCode &status) |
Adds a single attribute. More... | |
Expression | build (UErrorCode &status) |
Constructs a new immutable Expression using the operand and operator that were previously set. More... | |
Builder (UErrorCode &status) | |
Default constructor. More... | |
virtual | ~Builder () |
Destructor. More... | |
Builder (const Builder &)=delete | |
Builder & | operator= (const Builder &)=delete |
Builder (Builder &&)=delete | |
Builder & | operator= (Builder &&)=delete |
Friends | |
class | Expression |
The mutable Expression::Builder
class allows the operator to be constructed incrementally.
Builder is not copyable or movable.
Definition at line 1333 of file messageformat2_data_model.h.
icu::message2::data_model::Expression::Builder::Builder | ( | UErrorCode & | status | ) |
Default constructor.
Returns a Builder with no operator or operand set.
status | Input/output error code. |
|
virtual |
Destructor.
Builder& icu::message2::data_model::Expression::Builder::addAttribute | ( | const UnicodeString & | key, |
Operand && | value, | ||
UErrorCode & | status | ||
) |
Adds a single attribute.
key | The name of the attribute. |
value | The value (right-hand side) of the attribute. |
status | Input/output error code. |
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.
status | Input/output error code. |
Sets the operand of this expression.
rAnd | The operand to set. Passed by move. |
Sets the operator of this expression.
rAtor | The operator to set. Passed by move. |