@Test public void testGetCanonicalName() { assertEquals("MASTER.CLUSTER.ACTIVE_NODES", MetricsUtil.getCanonicalName(Master.Cluster.ACTIVE_NODES)); }
public static String getCanonicalName(Enum<?> e) { checkMetricsClass(e.getClass()); String [] groupAndContextNames = pattern.split(e.getClass().getCanonicalName().substring(24)); if (groupAndContextNames.length != 2) { throw new RuntimeException("Invalid Metric Enum Type: " + e.getClass().getName()); } return (groupAndContextNames[0] + DELIMITER + groupAndContextNames[1] + DELIMITER + e.name()).toUpperCase(); }
MetricsUtil { public static String getCanonicalName(Enum<?> e) { checkMetricsClass(e.getClass()); String [] groupAndContextNames = pattern.split(e.getClass().getCanonicalName().substring(24)); if (groupAndContextNames.length != 2) { throw new RuntimeException("Invalid Metric Enum Type: " + e.getClass().getName()); } return (groupAndContextNames[0] + DELIMITER + groupAndContextNames[1] + DELIMITER + e.name()).toUpperCase(); } }
MetricsUtil { public static String getCanonicalName(Enum<?> e) { checkMetricsClass(e.getClass()); String [] groupAndContextNames = pattern.split(e.getClass().getCanonicalName().substring(24)); if (groupAndContextNames.length != 2) { throw new RuntimeException("Invalid Metric Enum Type: " + e.getClass().getName()); } return (groupAndContextNames[0] + DELIMITER + groupAndContextNames[1] + DELIMITER + e.name()).toUpperCase(); }  }
MetricsUtil { public static String getCanonicalName(Enum<?> e) { checkMetricsClass(e.getClass()); String [] groupAndContextNames = pattern.split(e.getClass().getCanonicalName().substring(24)); if (groupAndContextNames.length != 2) { throw new RuntimeException("Invalid Metric Enum Type: " + e.getClass().getName()); } return (groupAndContextNames[0] + DELIMITER + groupAndContextNames[1] + DELIMITER + e.name()).toUpperCase(); }  static String getGroupName(Class clazz); static String getGroupName(Enum<?> e); static String getCanonicalContextName(Class<? extends Enum<?>> clazz); static String getContextName(Class<? extends Enum<?>> clazz); static String getCanonicalName(Enum<?> e); static String getSimpleName(Enum<?> e); }
MetricsUtil { public static String getCanonicalName(Enum<?> e) { checkMetricsClass(e.getClass()); String [] groupAndContextNames = pattern.split(e.getClass().getCanonicalName().substring(24)); if (groupAndContextNames.length != 2) { throw new RuntimeException("Invalid Metric Enum Type: " + e.getClass().getName()); } return (groupAndContextNames[0] + DELIMITER + groupAndContextNames[1] + DELIMITER + e.name()).toUpperCase(); }  static String getGroupName(Class clazz); static String getGroupName(Enum<?> e); static String getCanonicalContextName(Class<? extends Enum<?>> clazz); static String getContextName(Class<? extends Enum<?>> clazz); static String getCanonicalName(Enum<?> e); static String getSimpleName(Enum<?> e); static final String DELIMITER; }