icu::message2::FormattedValue Class Reference

A `FormattedValue` represents the result of formatting a `message2::Formattable`. More...

`#include <messageformat2_formattable.h>`

Inheritance diagram for icu::message2::FormattedValue:

## Public Member Functions

| FormattedValue (const UnicodeString &)
| Formatted string constructor. More...
| FormattedValue (number::FormattedNumber &&)
| Formatted number constructor. More...
| FormattedValue ()
| Default constructor. More...
bool | isString () const
| Returns true iff this is a formatted string. More...
bool | isNumber () const
| Returns true iff this is a formatted number. More...
const UnicodeString & | getString () const
| Gets the string contents of this value. More...
const number::FormattedNumber & | getNumber () const
| Gets the number contents of this value. More...
FormattedValue & | operator= (FormattedValue &&) noexcept
| Move assignment operator: The source FormattedValue will be left in a valid but undefined state. More...
| FormattedValue (FormattedValue &&other)
| Move constructor: The source FormattedValue will be left in a valid but undefined state. More...
virtual | ~FormattedValue ()
| Destructor. More...
Public Member Functions inherited from icu::UObject
virtual | ~UObject ()
| Destructor. More...
virtual UClassID | getDynamicClassID () const
| ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class. More...

## Detailed Description

A `FormattedValue` represents the result of formatting a `message2::Formattable`.

It contains either a string or a formatted number. (More types could be added in the future.)

`FormattedValue` is immutable and movable. It is not copyable.

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 586 of file messageformat2_formattable.h.

## Constructor & Destructor Documentation

## FormattedValue() [1/4]

icu::message2::FormattedValue::FormattedValue | ( | const UnicodeString & |  | ) |

explicit

Formatted string constructor.

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

Deprecated:
  This API is for technology preview only.

## FormattedValue() [2/4]

icu::message2::FormattedValue::FormattedValue | ( | number::FormattedNumber && |  | ) |

explicit

Formatted number constructor.

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

Deprecated:
  This API is for technology preview only.

## FormattedValue() [3/4]

icu::message2::FormattedValue::FormattedValue | ( |  | ) |

inline

Default constructor.

Leaves the FormattedValue in a valid but undefined state.

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 606 of file messageformat2_formattable.h.

## FormattedValue() [4/4]

icu::message2::FormattedValue::FormattedValue | ( | FormattedValue && | other | ) |

inline

Move constructor: The source FormattedValue will be left in a valid but undefined state.

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 656 of file messageformat2_formattable.h.

## ~FormattedValue()

virtual icu::message2::FormattedValue::~FormattedValue | ( |  | ) |

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

## getNumber()

const number::FormattedNumber& icu::message2::FormattedValue::getNumber | ( |  | ) | const

inline

Gets the number contents of this value.

If !isNumber(), then the result is undefined.

Returns
  A reference to a formatted number.

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 640 of file messageformat2_formattable.h.

## getString()

const UnicodeString& icu::message2::FormattedValue::getString | ( |  | ) | const

inline

Gets the string contents of this value.

If !isString(), then the result is undefined.

Returns
  A reference to a formatted string.

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 632 of file messageformat2_formattable.h.

## isNumber()

bool icu::message2::FormattedValue::isNumber | ( |  | ) | const

inline

Returns true iff this is a formatted number.

Returns
  True if and only if this value is a formatted number.

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 624 of file messageformat2_formattable.h.

## isString()

bool icu::message2::FormattedValue::isString | ( |  | ) | const

inline

Returns true iff this is a formatted string.

Returns
  True if and only if this value is a formatted string.

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 615 of file messageformat2_formattable.h.

## operator=()

FormattedValue& icu::message2::FormattedValue::operator= | ( | FormattedValue && |  | ) |

noexcept

Move assignment operator: The source FormattedValue will be left in a valid but undefined state.

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_formattable.h