com.eg.agent.android.instrumentation.MetricCategory Maven / Gradle / Ivy
package com.eg.agent.android.instrumentation;
import java.util.Map;
public enum MetricCategory {
NONE("None"),
VIEW_LOADING("View Loading"),
VIEW_LAYOUT("Layout"),
DATABASE("Database"),
IMAGE("Images"),
JSON("JSON"),
NETWORK("Network");
private String categoryName;
private static final Map methodMap = new java.util.HashMap() {
};
private MetricCategory(String categoryName) {
this.categoryName = categoryName;
}
public String getCategoryName() {
return this.categoryName;
}
public static MetricCategory categoryForMethod(String fullMethodName) {
if (fullMethodName == null) {
return NONE;
}
String methodName = null;
int hashIndex = fullMethodName.indexOf("#");
if (hashIndex >= 0) {
methodName = fullMethodName.substring(hashIndex + 1);
}
MetricCategory category = (MetricCategory) methodMap.get(methodName);
if (category == null)
category = NONE;
return category;
}
}