package com.unity3d.services.core.request.metrics; import java.util.HashMap; import java.util.Map; import java.util.Objects; /* loaded from: classes2.dex */ public class Metric { private static final String METRIC_NAME = "n"; private static final String METRIC_TAGS = "t"; private static final String METRIC_VALUE = "v"; private final String name; private final Map tags; private final Object value; public Metric(String str, Object obj, Map map) { this.name = str; this.value = obj; this.tags = map; } Map asMap() { HashMap hashMap = new HashMap(); String str = this.name; if (str != null) { hashMap.put("n", str); } Object obj = this.value; if (obj != null) { hashMap.put(METRIC_VALUE, obj); } Map map = this.tags; if (map != null) { hashMap.put(METRIC_TAGS, map); } return hashMap; } public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof Metric)) { return false; } Metric metric = (Metric) obj; return Objects.equals(this.name, metric.name) && Objects.equals(this.value, metric.value) && Objects.equals(this.tags, metric.tags); } public String getName() { return this.name; } public Map getTags() { return this.tags; } public Object getValue() { return this.value; } public int hashCode() { return Objects.hash(this.name, this.value, this.tags); } public String toString() { return "Metric{name='" + this.name + "', value='" + this.value + "', tags=" + this.tags + '}'; } }