Ver código fonte

汉字转拼音静态方法大小写分开

gaodm 4 anos atrás
pai
commit
2e9dd62267

+ 3 - 3
common/src/main/java/com/diagbot/util/Cn2SpellUtil.java

@@ -46,7 +46,7 @@ public class Cn2SpellUtil {
      * @return 拼音(大写)
      */
     public static String converterToSpell(String chines) {
-        return converterToSpellByCase(chines, HanyuPinyinCaseType.UPPERCASE);
+        return converterToSpellByCaseType(chines, HanyuPinyinCaseType.UPPERCASE);
     }
 
     /**
@@ -56,7 +56,7 @@ public class Cn2SpellUtil {
      * @return 拼音(小写)
      */
     public static String converterToSpellLow(String chines) {
-        return converterToSpellByCase(chines, HanyuPinyinCaseType.LOWERCASE);
+        return converterToSpellByCaseType(chines, HanyuPinyinCaseType.LOWERCASE);
     }
 
     /**
@@ -65,7 +65,7 @@ public class Cn2SpellUtil {
      * @param chines 汉字
      * @return 拼音
      */
-    private static String converterToSpellByCase(String chines, HanyuPinyinCaseType caseType) {
+    private static String converterToSpellByCaseType(String chines, HanyuPinyinCaseType caseType) {
         String pinyinName = "";
         char[] nameChar = chines.toCharArray();
         HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat();