assertUInt static method

int? assertUInt(
  1. int? in_num
)

0, +

  • 只允许自然数(0、正整数)通过,负数返回null

Implementation

static int? assertUInt(int? in_num) {
  if (null != in_num && in_num >= 0) {
    return in_num;
  }
  return null;
}