asInteger method
Returns this value as an integer.
Implementation
int? asInteger({PsDescriptorAccessMode mode = PsDescriptorAccessMode.strict}) => switch (this) {
PsIntegerValue(:final int value) => value,
PsLargeIntegerValue(:final int value) => value,
PsDoubleValue(:final double value) when mode == PsDescriptorAccessMode.compatible => value.round(),
PsUnitFloatValue(:final double value) when mode == PsDescriptorAccessMode.compatible => value.round(),
_ => null,
};