@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getNamespace() == null) ? 0 : getNamespace().hashCode()); hashCode = prime * hashCode + ((getMetricName() == null) ? 0 : getMetricName().hashCode()); hashCode = prime * hashCode + ((getDimensions() == null) ? 0 : getDimensions().hashCode()); return hashCode; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getNamespace() != null) sb.append("Namespace: ").append(getNamespace()).append(","); if (getMetricName() != null) sb.append("MetricName: ").append(getMetricName()).append(","); if (getDimensions() != null) sb.append("Dimensions: ").append(getDimensions()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Metric == false) return false; Metric other = (Metric) obj; if (other.getNamespace() == null ^ this.getNamespace() == null) return false; if (other.getNamespace() != null && other.getNamespace().equals(this.getNamespace()) == false) return false; if (other.getMetricName() == null ^ this.getMetricName() == null) return false; if (other.getMetricName() != null && other.getMetricName().equals(this.getMetricName()) == false) return false; if (other.getDimensions() == null ^ this.getDimensions() == null) return false; if (other.getDimensions() != null && other.getDimensions().equals(this.getDimensions()) == false) return false; return true; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getNamespace() == null) ? 0 : getNamespace().hashCode()); hashCode = prime * hashCode + ((getMetricName() == null) ? 0 : getMetricName().hashCode()); hashCode = prime * hashCode + ((getDimensions() == null) ? 0 : getDimensions().hashCode()); return hashCode; }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getNamespace() != null) sb.append("Namespace: " + getNamespace() + ","); if (getMetricName() != null) sb.append("MetricName: " + getMetricName() + ","); if (getDimensions() != null) sb.append("Dimensions: " + getDimensions()); sb.append("}"); return sb.toString(); }
if (metric != null) { if (metric.getNamespace() != null) { request.addParameter("MetricDataQueries.member." + metricDataQueriesListIndex + ".MetricStat.Metric.Namespace", StringUtils.fromString(metric.getNamespace()));
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Metric == false) return false; Metric other = (Metric) obj; if (other.getNamespace() == null ^ this.getNamespace() == null) return false; if (other.getNamespace() != null && other.getNamespace().equals(this.getNamespace()) == false) return false; if (other.getMetricName() == null ^ this.getMetricName() == null) return false; if (other.getMetricName() != null && other.getMetricName().equals(this.getMetricName()) == false) return false; if (other.getDimensions() == null ^ this.getDimensions() == null) return false; if (other.getDimensions() != null && other.getDimensions().equals(this.getDimensions()) == false) return false; return true; } }
if (metric != null) { if (metric.getNamespace() != null) { request.addParameter("Metrics.member." + metricsListIndex + ".MetricStat.Metric.Namespace", StringUtils.fromString(metric.getNamespace()));
public void marshall(Metric _metric, Request<?> request, String _prefix) { String prefix; if (_metric.getNamespace() != null) { prefix = _prefix + "Namespace"; String namespace = _metric.getNamespace(); request.addParameter(prefix, StringUtils.fromString(namespace)); } if (_metric.getMetricName() != null) { prefix = _prefix + "MetricName"; String metricName = _metric.getMetricName(); request.addParameter(prefix, StringUtils.fromString(metricName)); } if (_metric.getDimensions() != null) { prefix = _prefix + "Dimensions"; java.util.List<Dimension> dimensions = _metric.getDimensions(); int dimensionsIndex = 1; String dimensionsPrefix = prefix; for (Dimension dimensionsItem : dimensions) { prefix = dimensionsPrefix + ".member." + dimensionsIndex; if (dimensionsItem != null) { DimensionStaxMarshaller.getInstance().marshall(dimensionsItem, request, prefix + "."); } dimensionsIndex++; } prefix = dimensionsPrefix; } }