◆ getNoValueMessage()
Gets a message explaining why there is no value.
Calling this if hasValue() returned true will result in undefined behavior.
- Returns
- message explaining the reason for the missing value
\r\n
Encapsulates a value returned an instance of ResultsBase for a specified property.
An instance contains either the value, or the reason which there is no value.
Before retrieving the value itself, its presence should first be checked using the hasValue() method. The typed value can be returned either using the getValue() method, or more simply, by dereferencing (similarly to an iterator). If there is no value, then an exception will be thrown.
## Usage Example
Constructors | |
Value ()
Default constructor.
| |
Value Methods | |
bool | hasValue ()
Indicates whether or not a valid value has been returned by the ResultsBase instance. More...
|
fiftyoneDegreesResultsNoValueReason | getNoValueReason ()
Indicates the reason why valid values are not available. More...
|
const char * | getNoValueMessage ()
Gets a message explaining why there is no value. More...
|
T | getValue () |
void | setValue (T targetValue) |
void | setNoValueReason (fiftyoneDegreesResultsNoValueReason reason, const char *message)
Set the reason there is no value available. More...
|
Operators | |
T | operator * () |
Gets a message explaining why there is no value.
Calling this if hasValue() returned true will result in undefined behavior.
fiftyoneDegreesResultsNoValueReason FiftyoneDegrees::Common::Value< T >::getNoValueReason | ( | ) |
Indicates the reason why valid values are not available.
This can be called if hasValue() returns false. For a more detailed message, call getNoValueMessage().
Gets the value contained in the Value instance.
If there is no valid value, then an exception will be thrown. To prevent an exception, the hasValue() method should be checked first.
Indicates whether or not a valid value has been returned by the ResultsBase instance.
Gets the value contained in the Value instance.
If there is no valid value, then an exception will be thrown. To prevent an exception, the hasValue() method should be checked first.
void FiftyoneDegrees::Common::Value< T >::setNoValueReason | ( | fiftyoneDegreesResultsNoValueReason | reason, |
const char * | message | ||
) |
Set the reason there is no value available.
This will be used if an exception is thrown by the setValue method.
Set the value to be contained in the Value instance.