toInt method Null safety

int toInt()

Return an integer.

Implementation

int toInt() {
  switch (this) {
    case DistanceModel.none:
      return SYZ_DISTANCE_MODEL.SYZ_DISTANCE_MODEL_NONE;
    case DistanceModel.linear:
      return SYZ_DISTANCE_MODEL.SYZ_DISTANCE_MODEL_LINEAR;
    case DistanceModel.exponential:
      return SYZ_DISTANCE_MODEL.SYZ_DISTANCE_MODEL_EXPONENTIAL;
    case DistanceModel.inverse:
      return SYZ_DISTANCE_MODEL.SYZ_DISTANCE_MODEL_INVERSE;
    case DistanceModel.count:
      return SYZ_DISTANCE_MODEL.SYZ_DISTANCE_MODEL_COUNT;
  }
}