ICU 78.2 78.2

Public Member Functions | Friends
icu::message2::data_model::Pattern::Builder Class Reference

The mutable `Pattern::Builder` class allows the pattern to be constructed one part at a time. More...

`#include <messageformat2_data_model.h>`

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

## Public Member Functions
Builder & | add (Expression &&part, UErrorCode &status) noexcept
| Adds a single expression part to the pattern. More...
Builder & | add (Markup &&part, UErrorCode &status) noexcept
| Adds a single markup part to the pattern. More...
Builder & | add (UnicodeString &&part, UErrorCode &status) noexcept
| Adds a single text part to the pattern. More...
Pattern | build (UErrorCode &status) const noexcept
| Constructs a new immutable `Pattern` using the list of parts set with previous `add()` calls. 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 | Pattern

## Detailed Description

The mutable `Pattern::Builder` class allows the pattern to be constructed one part at a time.

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 1580 of file messageformat2_data_model.h.

## Constructor & Destructor Documentation

## ◆ Builder()

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

Default constructor.

Returns a Builder with an empty sequence of PatternParts.

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::Pattern::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

## ◆ add() [1/3]

Builder& icu::message2::data_model::Pattern::Builder::add | ( | Expression && | part,
|  | UErrorCode & | status
| ) |  |
| noexcept

Adds a single expression part to the pattern.

Parameters

  part | The part to be added (passed by move)
  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.

## ◆ add() [2/3]

Builder& icu::message2::data_model::Pattern::Builder::add | ( | Markup && | part,
|  | UErrorCode & | status
| ) |  |
| noexcept

Adds a single markup part to the pattern.

Parameters

  part | The part to be added (passed by move)
  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.

## ◆ add() [3/3]

Builder& icu::message2::data_model::Pattern::Builder::add | ( | UnicodeString && | part,
|  | UErrorCode & | status
| ) |  |
| noexcept

Adds a single text part to the pattern.

Copies `part`.

Parameters

  part | The part to be added (passed by move)
  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()

Pattern icu::message2::data_model::Pattern::Builder::build | ( | UErrorCode & | status | ) | const
| noexcept

Constructs a new immutable `Pattern` using the list of parts set with previous `add()` calls.

The builder object (`this`) can still be used after calling `build()`.

Parameters

  status | Input/output error code.

Returns
  The pattern object

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

Deprecated:
  This API is for technology preview only.

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

- i18n/unicode/messageformat2_data_model.h