toJson method

String toJson()

将枚举值转换为 JSON(String)表示

Implementation

String toJson() {
  // 直接返回枚举名
  return toString().split('.').last;
}