pip_services3_commons.convert.LongConverter module
pip_services3_commons.convert.LongConverter
Long conversion utilities
- copyright
Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.
- license
MIT, see LICENSE for more details.
-
class
pip_services3_commons.convert.LongConverter.
LongConverter
Bases:
object
- Converts arbitrary values into longs using extended conversion __rules:
Strings are converted to floats, then to longs
DateTime: total number of milliseconds since unix epoсh
Boolean: 1 for true and 0 for false
-
static
to_long
(value: Any) → int Converts value into long or returns 0 when conversion is not possible.
- Parameters
value – the value to convert.
- Returns
long value or 0 when conversion is not supported.