@Test public void testUrlEncodeByPercent() { final StringBuilder sb = new StringBuilder("??????"); GroupKey.urlEncode("%", sb); Assert.assertNotNull(sb); Assert.assertEquals("??????%25", sb.toString()); }
static void urlEncode(String str, StringBuilder sb) { for (int idx = 0; idx < str.length(); ++idx) { char c = str.charAt(idx); if ('+' == c) { sb.append("%2B"); } else if ('%' == c) { sb.append("%25"); } else { sb.append(c); } } }
GroupKey { static void urlEncode(String str, StringBuilder sb) { for (int idx = 0; idx < str.length(); ++idx) { char c = str.charAt(idx); if ('+' == c) { sb.append("%2B"); } else if ('%' == c) { sb.append("%25"); } else { sb.append(c); } } } }
GroupKey { static void urlEncode(String str, StringBuilder sb) { for (int idx = 0; idx < str.length(); ++idx) { char c = str.charAt(idx); if ('+' == c) { sb.append("%2B"); } else if ('%' == c) { sb.append("%25"); } else { sb.append(c); } } }  }
GroupKey { static void urlEncode(String str, StringBuilder sb) { for (int idx = 0; idx < str.length(); ++idx) { char c = str.charAt(idx); if ('+' == c) { sb.append("%2B"); } else if ('%' == c) { sb.append("%25"); } else { sb.append(c); } } }  static String getKey(String dataId, String group); static String getKey(String dataId, String group, String datumStr); static String getKeyTenant(String dataId, String group, String tenant); static String[] parseKey(String groupKey); }
GroupKey { static void urlEncode(String str, StringBuilder sb) { for (int idx = 0; idx < str.length(); ++idx) { char c = str.charAt(idx); if ('+' == c) { sb.append("%2B"); } else if ('%' == c) { sb.append("%25"); } else { sb.append(c); } } }  static String getKey(String dataId, String group); static String getKey(String dataId, String group, String datumStr); static String getKeyTenant(String dataId, String group, String tenant); static String[] parseKey(String groupKey);  }