#include <KeypleAssert.h>
|
const KeypleAssert & | notNull (void *obj, const std::string &name) const |
|
const KeypleAssert & | notEmpty (const std::string &obj, const std::string &name) const |
|
const KeypleAssert & | notEmpty (const std::vector< uint8_t > &obj, const std::string &name) const |
|
const KeypleAssert & | isTrue (const bool condition, const std::string &name) const |
|
const KeypleAssert & | greaterOrEqual (const int number, const int minValue, const std::string &name) const |
|
const KeypleAssert & | isEqual (const int number, const int value, const std::string &name) const |
|
const KeypleAssert & | isInRange (const int number, const int minValue, const int maxValue, const std::string &name) const |
|
The utility class KeypleAssert exposes very useful methods for testing method call parameters and raising a keyple::common::exception::IllegalArgumentException unchecked exception.
- Since
- 0.9
◆ getInstance()
const KeypleAssert & keyple::core::util::KeypleAssert::getInstance |
( |
| ) |
|
|
static |
Gets the unique instance.
- Returns
- the instance
◆ greaterOrEqual()
const KeypleAssert & keyple::core::util::KeypleAssert::greaterOrEqual |
( |
const int |
number, |
|
|
const int |
minValue, |
|
|
const std::string & |
name |
|
) |
| const |
Assert that an integer is not null and is greater than or equal to minValue.
- Parameters
-
number | the number to check |
minValue | the min accepted value |
name | the object name |
- Returns
- the current instance
- Exceptions
-
IllegalArgumentException | if number is null or has a value less than minValue. |
- Since
- 0.9
◆ isEqual()
const KeypleAssert & keyple::core::util::KeypleAssert::isEqual |
( |
const int |
number, |
|
|
const int |
value, |
|
|
const std::string & |
name |
|
) |
| const |
Assert that an integer is equal to value.
- Parameters
-
number | the number to check |
value | the expected value |
name | the object name |
- Returns
- the current instance
- Exceptions
-
IllegalArgumentException | if number is null or has a value less than minValue. |
- Since
- 0.9
◆ isInRange()
const KeypleAssert & keyple::core::util::KeypleAssert::isInRange |
( |
const int |
number, |
|
|
const int |
minValue, |
|
|
const int |
maxValue, |
|
|
const std::string & |
name |
|
) |
| const |
Assert that an integer is not null and is in the range minValue, maxValue.
- Parameters
-
number | the number to check |
minValue | the min accepted value |
maxValue | the max accepted value |
name | the object name |
- Returns
- the current instance
- Exceptions
-
IllegalArgumentException | if number is null or is out of range. |
- Since
- 0.9
◆ isTrue()
const KeypleAssert & keyple::core::util::KeypleAssert::isTrue |
( |
const bool |
condition, |
|
|
const std::string & |
name |
|
) |
| const |
Assert that a condition is true.
- Parameters
-
condition | the condition to check |
name | the object name |
- Returns
- the current instance
- Exceptions
-
IllegalArgumentException | if condition is null or false |
- Since
- 0.9
◆ notEmpty() [1/2]
const KeypleAssert & keyple::core::util::KeypleAssert::notEmpty |
( |
const std::string & |
obj, |
|
|
const std::string & |
name |
|
) |
| const |
Assert that the input string is not null and not empty.
- Parameters
-
obj | the object to check |
name | the object name |
- Returns
- the current instance
- Exceptions
-
IllegalArgumentException | if object is null or empty |
- Since
- 0.9
◆ notEmpty() [2/2]
const KeypleAssert & keyple::core::util::KeypleAssert::notEmpty |
( |
const std::vector< uint8_t > & |
obj, |
|
|
const std::string & |
name |
|
) |
| const |
Assert that a byte array is not null and not empty.
- Parameters
-
obj | the object to check |
name | the object name |
- Returns
- the current instance
- Exceptions
-
IllegalArgumentException | if object is null or empty |
- Since
- 0.9
◆ notNull()
const KeypleAssert & keyple::core::util::KeypleAssert::notNull |
( |
void * |
obj, |
|
|
const std::string & |
name |
|
) |
| const |
Assert that the input object is not null.
- Parameters
-
obj | the object to check |
name | the object name |
- Returns
- the current instance
- Exceptions
-
IllegalArgumentException | if object is null |
- Since
- 0.9
The documentation for this class was generated from the following files: