[#BloombergLP-ball-UserFieldValue]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::UserFieldValue
:relfileprefix: ../../
:mrdocs:

This class implements a value&hyphen;semantic type for representing the value of a user field in a log record&period;

== Synopsis

Declared in `&lt;ball&lowbar;userfieldvalue&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class UserFieldValue;
----

== Description

A user field value acts as a discriminated union, and may represent a value of any of the types described in `ball&colon;&colon;UserFieldType` or an unset value (indicated by type `ball&colon;&colon;UserFieldType&colon;&colon;e&lowbar;VOID`)&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/ball/UserFieldValue/2constructor-071.adoc[`UserFieldValue`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/ball/UserFieldValue/operator_assign.adoc[`operator&equals;`] 
| Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object&period;
| xref:BloombergLP/ball/UserFieldValue/allocator.adoc[`allocator`] 
| Return the allocator used by this object to supply memory&period;
| xref:BloombergLP/ball/UserFieldValue/isUnset.adoc[`isUnset`] 
| Return `true` if this object has the unset value, and `false` otherwise&period; Note that if `isUnset()` returns `true`, then `type()` returns `ball&colon;&colon;UserFieldType&colon;&colon;e&lowbar;VOID`&period;
| xref:BloombergLP/ball/UserFieldValue/print.adoc[`print`] 
| Format this object to the specified output `stream`&period;
| xref:BloombergLP/ball/UserFieldValue/reset.adoc[`reset`] 
| Set this object to have the unset value&period; After this operation, `type() &equals;&equals; ball&colon;&colon;UserFieldType&colon;&colon;e&lowbar;VOID`&period;
| xref:BloombergLP/ball/UserFieldValue/setCharArray.adoc[`setCharArray`] 
| Set this object to have the specified `value`&period; After this operation, `type() &equals;&equals; ball&colon;&colon;UserFieldType&colon;&colon;e&lowbar;CHAR&lowbar;ARRAY`&period;
| xref:BloombergLP/ball/UserFieldValue/setDatetimeTz.adoc[`setDatetimeTz`] 
| Set this object to have the specified `value`&period; After this operation, `type() &equals;&equals; ball&colon;&colon;UserFieldType&colon;&colon;e&lowbar;DATETIMETZ`&period;
| xref:BloombergLP/ball/UserFieldValue/setDouble.adoc[`setDouble`] 
| Set this object to have the specified `value`&period; After this operation, `type() &equals;&equals; ball&colon;&colon;UserFieldType&colon;&colon;e&lowbar;DOUBLE`&period;
| xref:BloombergLP/ball/UserFieldValue/setInt64.adoc[`setInt64`] 
| Set this object to have the specified `value`&period; After this operation, `type() &equals;&equals; ball&colon;&colon;UserFieldType&colon;&colon;e&lowbar;INT64`&period;
| xref:BloombergLP/ball/UserFieldValue/setString.adoc[`setString`] 
| Set this object to have the specified `value`&period; After this operation, `type() &equals;&equals; ball&colon;&colon;UserFieldType&colon;&colon;e&lowbar;STRING`&period;
| xref:BloombergLP/ball/UserFieldValue/swap.adoc[`swap`] 
| Efficiently exchange the value of this object with the value of the specified `other` object&period;
| xref:BloombergLP/ball/UserFieldValue/theCharArray.adoc[`theCharArray`] 
| Return a reference providing non&hyphen;modifiable access to the `bsl&colon;&colon;vector&lt;char&gt;` value of this object&period;
| xref:BloombergLP/ball/UserFieldValue/theDatetimeTz.adoc[`theDatetimeTz`] 
| Return a reference providing non&hyphen;modifiable access to the `DatetimeTz` value of this object&period;
| xref:BloombergLP/ball/UserFieldValue/theDouble.adoc[`theDouble`] 
| Return a reference providing non&hyphen;modifiable access to the double value of this object&period; The behavior is undefined unless `type() &equals;&equals; ball&colon;&colon;UserFieldType&colon;&colon;e&lowbar;DOUBLE`&period;
| xref:BloombergLP/ball/UserFieldValue/theInt64.adoc[`theInt64`] 
| Return a reference providing non&hyphen;modifiable access to the 64&hyphen;bit integer value of this object&period;
| xref:BloombergLP/ball/UserFieldValue/theString.adoc[`theString`] 
| Return a reference providing non&hyphen;modifiable access to the string value of this object&period; The behavior is undefined unless `type() &equals;&equals; ball&colon;&colon;UserFieldType&colon;&colon;e&lowbar;STRING`&period;
| xref:BloombergLP/ball/UserFieldValue/type.adoc[`type`] 
| Return the type of this user field value&period; The type `ball&colon;&colon;UserFieldValue&colon;&colon;e&lowbar;VOID` represents the unset value&period;
| xref:BloombergLP/ball/UserFieldValue/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;UserFieldValue, UsesBslmaAllocator&gt;`] 
| Declare that this type uses a `bslma` allocator&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/ball/swap-0a.adoc[BloombergLP::ball::swap]`
| Swap the value of the specified `a` object with the value of the specified `b` object&period;
| `xref:BloombergLP/ball/operator_eq-048.adoc[BloombergLP::ball::operator&equals;&equals;]`
| Return `true` if the specified `lhs` and `rhs` objects have the same value, and `false` otherwise&period;
|===

== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/ball/operator_not_eq-066.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` and `rhs` objects do not have the same value, and `false` otherwise&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
