StringUtil { public static String hankakuToZenkaku(String value) { if (value == null || "".equals(value)) { return value; } char[] chars = value.toCharArray(); StringBuilder returnValue = new StringBuilder(); String getValue = null; Character nextvalue = null; for (int i = 0; i < chars.length; i++) { getValue = getZenkakuMoji(chars[i]); if (getValue != null) { returnValue.append(getValue); } else if (i == (chars.length - 1)) { getValue = getZenkakuKasatahaMoji(chars[i]); if (getValue != null) { returnValue.append(getValue); } else if (Character.valueOf(chars[i]).equals( Character.valueOf('ﾜ'))) { returnValue.append("ワ"); } else if (Character.valueOf(chars[i]).equals( Character.valueOf('ｦ'))) { returnValue.append("ヲ"); } else { returnValue.append(String.valueOf(chars[i])); } } else { nextvalue = Character.valueOf(chars[i + 1]); if (nextvalue.equals(Character.valueOf('ﾞ'))) { getValue = getZenkakuDakuMoji(chars[i]); if (getValue != null) { returnValue.append(getValue); i++; } else if (Character.valueOf(chars[i]).equals( Character.valueOf('ﾜ'))) { returnValue.append(ZENKAKU_WA_DAKUTEN); i++; } else if (Character.valueOf(chars[i]).equals( Character.valueOf('ｦ'))) { returnValue.append(ZENKAKU_WO_DAKUTEN); i++; } else { returnValue.append((String.valueOf(chars[i]) + "゛")); i++; } } else if (nextvalue.equals(Character.valueOf('ﾟ'))) { getValue = getZenkakuHandakuMoji(chars[i]); if (getValue != null) { returnValue.append(getValue); i++; } else { getValue = getZenkakuKasatahaMoji(chars[i]); if (getValue == null && (Character.valueOf('ﾜ')).equals(chars[i])) { returnValue.append("ワ").append("゜"); } else if ((Character.valueOf('ｦ')).equals(chars[i])) { returnValue.append("ヲ").append("゜"); } else { returnValue.append(String.valueOf(getValue)).append("゜"); } i++; } } else { getValue = getZenkakuKasatahaMoji(chars[i]); if (getValue != null) { returnValue.append(getValue); } else if (Character.valueOf(chars[i]).equals( Character.valueOf('ﾜ'))) { returnValue.append("ワ"); } else if (Character.valueOf(chars[i]).equals( Character.valueOf('ｦ'))) { returnValue.append("ヲ"); } else { returnValue.append(String.valueOf(chars[i])); } } } } return returnValue.toString(); }  static boolean isWhitespace(char c); static boolean isZenHankakuSpace(char c); static String rtrim(String str); static String ltrim(String str); static String trim(String str); static String rtrimZ(String str); static String ltrimZ(String str); static String trimZ(String str); static String toShortClassName(String longClassName); static String getExtension(String name); static String toHexString(byte[] byteArray, String delim); static String capitalizeInitial(String str); static String[] parseCSV(String csvString); static String[] parseCSV(String csvString, String escapeString); static String dump(Map<?, ?> map); static String getArraysStr(Object[] arrayObj); static String hankakuToZenkaku(String value); static String zenkakuToHankaku(String value); static String filter(String str); static String toLikeCondition(String condition); static int getByteLength(String value, String encoding); static final String LINE_SEP; static final String LIKE_ESC_CHAR; }
@Test public void testHankakuToZenkaku06() throws Exception { String input = "ｶﾞｻﾞﾀﾞﾊﾞｳﾞ"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("ガザダバヴ", result); }
@Test public void testHankakuToZenkaku07() throws Exception { String input = "ﾎﾟ"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("ポ", result); }
@Test public void testHankakuToZenkaku08() throws Exception { String input = "ﾊﾟﾋﾟﾌﾟﾍﾟﾎﾟ"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("パピプペポ", result); }
@Test public void testHankakuToZenkaku09() throws Exception { String input = "ﾜ"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("ワ", result); }
@Test public void testHankakuToZenkaku10() throws Exception { String input = "ｦ"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("ヲ", result); }
@Test public void testHankakuToZenkaku11() throws Exception { String input = "ﾜﾞ"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("\u30f7", result); }
@Test public void testHankakuToZenkaku12() throws Exception { String input = "ｦﾞ"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("\u30fa", result); }
@Test public void testHankakuToZenkaku13() throws Exception { String input = "Aﾜ1"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("Ａワ１", result); }
@Test public void testHankakuToZenkaku14() throws Exception { String input = "Bｦ8"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("Ｂヲ８", result); }
@Test public void testHankakuToZenkaku15() throws Exception { String input = "Bﾜﾞ8"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("Ｂ\u30f7８", result); }
@Test public void testHankakuToZenkaku16() throws Exception { String input = "Bｦﾞ8"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("Ｂ\u30fa８", result); }
@Test public void testHankakuToZenkaku17() throws Exception { String input = "ｱAﾜ"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("アＡワ", result); }
@Test public void testHankakuToZenkaku18() throws Exception { String input = "tBｦ"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("ｔＢヲ", result); }
@Test public void testHankakuToZenkaku19() throws Exception { String input = "ｻBﾜﾞ"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("サＢ\u30f7", result); }
@Test public void testHankakuToZenkaku20() throws Exception { String input = "ｱBｦﾞ"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("アＢ\u30fa", result); }
@Test public void testHankakuToZenkaku21() throws Exception { String input = "サｼズｾﾞソ"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("サシズゼソ", result); }
@Test public void testHankakuToZenkaku22() throws Exception { String input = null; String result = StringUtil.hankakuToZenkaku(input); assertNull(result); }
@Test public void testHankakuToZenkaku23() throws Exception { String input = ""; String result = StringUtil.hankakuToZenkaku(input); assertEquals("", result); }
@Test public void testHankakuToZenkaku24() throws Exception { String input = "ｶﾟｷﾟ"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("カ゜キ゜", result); }
@Test public void testHankakuToZenkaku25() throws Exception { String input = "ﾜﾟｦﾟ"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("ワ゜ヲ゜", result); }
@Test public void testHankakuToZenkaku01() throws Exception { String input = "A"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("Ａ", result); }
@Test public void testHankakuToZenkaku02() throws Exception { String input = "ｱﾞ!A8"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("ア゛！Ａ８", result); }
@Test public void testHankakuToZenkaku03() throws Exception { String input = "ｻ"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("サ", result); }
@Test public void testHankakuToZenkaku04() throws Exception { String input = "ｶｻﾀﾊｳ"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("カサタハウ", result); }
@Test public void testHankakuToZenkaku05() throws Exception { String input = "ｶﾞ"; String result = StringUtil.hankakuToZenkaku(input); assertEquals("ガ", result); }