/** * 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 (getLabel() != null) sb.append("Label: ").append(getLabel()).append(","); if (getDatapoints() != null) sb.append("Datapoints: ").append(getDatapoints()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetMetricStatisticsResult == false) return false; GetMetricStatisticsResult other = (GetMetricStatisticsResult) obj; if (other.getLabel() == null ^ this.getLabel() == null) return false; if (other.getLabel() != null && other.getLabel().equals(this.getLabel()) == false) return false; if (other.getDatapoints() == null ^ this.getDatapoints() == null) return false; if (other.getDatapoints() != null && other.getDatapoints().equals(this.getDatapoints()) == false) return false; return true; }
/** * 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 (getLabel() != null) sb.append("Label: " + getLabel() + ","); if (getDatapoints() != null) sb.append("Datapoints: " + getDatapoints()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetMetricStatisticsResult == false) return false; GetMetricStatisticsResult other = (GetMetricStatisticsResult) obj; if (other.getLabel() == null ^ this.getLabel() == null) return false; if (other.getLabel() != null && other.getLabel().equals(this.getLabel()) == false) return false; if (other.getDatapoints() == null ^ this.getDatapoints() == null) return false; if (other.getDatapoints() != null && other.getDatapoints().equals(this.getDatapoints()) == false) return false; return true; } }
@TaskAction public void getMetricStatistics() { // NOPMD try { GetMetricStatisticsResult result = getMetricStatistics(getMetricName(), getNamespace(), getStatistics(), getExtendedStatistics(), getUnit()); datapoints = result.getDatapoints(); label = result.getLabel(); } catch (AmazonServiceException e) { throw new GradleException("Fail to describe metric: " + getMetricName(), e); } } }