@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getMetricName() == null) ? 0 : getMetricName().hashCode()); hashCode = prime * hashCode + ((getNamespace() == null) ? 0 : getNamespace().hashCode()); hashCode = prime * hashCode + ((getDimensions() == null) ? 0 : getDimensions().hashCode()); hashCode = prime * hashCode + ((getStatistic() == null) ? 0 : getStatistic().hashCode()); hashCode = prime * hashCode + ((getUnit() == null) ? 0 : getUnit().hashCode()); return hashCode; }
/** * <p> * The dimensions of the metric. * </p> * * @param dimensions * The dimensions of the metric. * @return Returns a reference to this object so that method calls can be chained together. */ public CustomizedMetricSpecification withDimensions(java.util.Collection<MetricDimension> dimensions) { setDimensions(dimensions); return this; }
/** * <p> * The name of the metric. * </p> * * @param metricName * The name of the metric. * @return Returns a reference to this object so that method calls can be chained together. */ public CustomizedMetricSpecification withMetricName(String metricName) { setMetricName(metricName); return this; }
public CustomizedMetricSpecification unmarshall(StaxUnmarshallerContext context) throws Exception { CustomizedMetricSpecification customizedMetricSpecification = new CustomizedMetricSpecification(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; customizedMetricSpecification.setMetricName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; customizedMetricSpecification.setNamespace(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; customizedMetricSpecification.withDimensions(new ArrayList<MetricDimension>()); continue; customizedMetricSpecification.withDimensions(MetricDimensionStaxUnmarshaller.getInstance().unmarshall(context)); continue; customizedMetricSpecification.setStatistic(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; customizedMetricSpecification.setUnit(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue;
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPredefinedMetricSpecification() == null) ? 0 : getPredefinedMetricSpecification().hashCode()); hashCode = prime * hashCode + ((getCustomizedMetricSpecification() == null) ? 0 : getCustomizedMetricSpecification().hashCode()); hashCode = prime * hashCode + ((getTargetValue() == null) ? 0 : getTargetValue().hashCode()); hashCode = prime * hashCode + ((getDisableScaleIn() == null) ? 0 : getDisableScaleIn().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TargetTrackingConfiguration == false) return false; TargetTrackingConfiguration other = (TargetTrackingConfiguration) obj; if (other.getPredefinedMetricSpecification() == null ^ this.getPredefinedMetricSpecification() == null) return false; if (other.getPredefinedMetricSpecification() != null && other.getPredefinedMetricSpecification().equals(this.getPredefinedMetricSpecification()) == false) return false; if (other.getCustomizedMetricSpecification() == null ^ this.getCustomizedMetricSpecification() == null) return false; if (other.getCustomizedMetricSpecification() != null && other.getCustomizedMetricSpecification().equals(this.getCustomizedMetricSpecification()) == false) return false; if (other.getTargetValue() == null ^ this.getTargetValue() == null) return false; if (other.getTargetValue() != null && other.getTargetValue().equals(this.getTargetValue()) == false) return false; if (other.getDisableScaleIn() == null ^ this.getDisableScaleIn() == null) return false; if (other.getDisableScaleIn() != null && other.getDisableScaleIn().equals(this.getDisableScaleIn()) == false) return false; return true; }
/** * <p> * The dimensions of the metric. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param dimensions <p> * The dimensions of the metric. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public CustomizedMetricSpecification withDimensions(MetricDimension... dimensions) { if (getDimensions() == null) { this.dimensions = new java.util.ArrayList<MetricDimension>(dimensions.length); } for (MetricDimension value : dimensions) { this.dimensions.add(value); } return this; }
public CustomizedMetricSpecification unmarshall(StaxUnmarshallerContext context) throws Exception { CustomizedMetricSpecification customizedMetricSpecification = new CustomizedMetricSpecification(); customizedMetricSpecification.setMetricName(StringStaxUnmarshaller .getInstance().unmarshall(context)); continue; customizedMetricSpecification.setNamespace(StringStaxUnmarshaller.getInstance() .unmarshall(context)); continue; customizedMetricSpecification.withDimensions(MetricDimensionStaxUnmarshaller .getInstance().unmarshall(context)); continue; customizedMetricSpecification.setStatistic(StringStaxUnmarshaller.getInstance() .unmarshall(context)); continue; customizedMetricSpecification.setUnit(StringStaxUnmarshaller.getInstance() .unmarshall(context)); continue;
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPredefinedMetricSpecification() == null) ? 0 : getPredefinedMetricSpecification().hashCode()); hashCode = prime * hashCode + ((getCustomizedMetricSpecification() == null) ? 0 : getCustomizedMetricSpecification().hashCode()); hashCode = prime * hashCode + ((getTargetValue() == null) ? 0 : getTargetValue().hashCode()); hashCode = prime * hashCode + ((getDisableScaleIn() == null) ? 0 : getDisableScaleIn().hashCode()); return hashCode; }
return false; if (other.getCustomizedMetricSpecification() != null && other.getCustomizedMetricSpecification().equals( this.getCustomizedMetricSpecification()) == false) return false;
return false; CustomizedMetricSpecification other = (CustomizedMetricSpecification) obj; if (other.getMetricName() == null ^ this.getMetricName() == null) return false; if (other.getMetricName() != null && other.getMetricName().equals(this.getMetricName()) == false) return false; if (other.getNamespace() == null ^ this.getNamespace() == null) return false; if (other.getNamespace() != null && other.getNamespace().equals(this.getNamespace()) == false) return false; if (other.getDimensions() == null ^ this.getDimensions() == null) return false; if (other.getDimensions() != null && other.getDimensions().equals(this.getDimensions()) == false) return false; if (other.getStatistic() == null ^ this.getStatistic() == null) return false; if (other.getStatistic() != null && other.getStatistic().equals(this.getStatistic()) == false) return false; if (other.getUnit() == null ^ this.getUnit() == null) return false; if (other.getUnit() != null && other.getUnit().equals(this.getUnit()) == false) return false; return true;
/** * <p> * The dimensions of the metric. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setDimensions(java.util.Collection)} or {@link #withDimensions(java.util.Collection)} if you want to * override the existing values. * </p> * * @param dimensions * The dimensions of the metric. * @return Returns a reference to this object so that method calls can be chained together. */ public CustomizedMetricSpecification withDimensions(MetricDimension... dimensions) { if (this.dimensions == null) { setDimensions(new com.amazonaws.internal.SdkInternalList<MetricDimension>(dimensions.length)); } for (MetricDimension ele : dimensions) { this.dimensions.add(ele); } return this; }
/** * 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 (getMetricName() != null) sb.append("MetricName: ").append(getMetricName()).append(","); if (getNamespace() != null) sb.append("Namespace: ").append(getNamespace()).append(","); if (getDimensions() != null) sb.append("Dimensions: ").append(getDimensions()).append(","); if (getStatistic() != null) sb.append("Statistic: ").append(getStatistic()).append(","); if (getUnit() != null) sb.append("Unit: ").append(getUnit()); sb.append("}"); return sb.toString(); }
/** * <p> * The dimensions of the metric. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param dimensions <p> * The dimensions of the metric. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public CustomizedMetricSpecification withDimensions( java.util.Collection<MetricDimension> dimensions) { setDimensions(dimensions); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getMetricName() == null) ? 0 : getMetricName().hashCode()); hashCode = prime * hashCode + ((getNamespace() == null) ? 0 : getNamespace().hashCode()); hashCode = prime * hashCode + ((getDimensions() == null) ? 0 : getDimensions().hashCode()); hashCode = prime * hashCode + ((getStatistic() == null) ? 0 : getStatistic().hashCode()); hashCode = prime * hashCode + ((getUnit() == null) ? 0 : getUnit().hashCode()); return hashCode; }
if (customizedMetricSpecification != null) { if (customizedMetricSpecification.getMetricName() != null) { request.addParameter("TargetTrackingConfiguration.CustomizedMetricSpecification.MetricName", StringUtils.fromString(customizedMetricSpecification.getMetricName())); if (customizedMetricSpecification.getNamespace() != null) { request.addParameter("TargetTrackingConfiguration.CustomizedMetricSpecification.Namespace", StringUtils.fromString(customizedMetricSpecification.getNamespace())); if (!customizedMetricSpecification.getDimensions().isEmpty() || !((com.amazonaws.internal.SdkInternalList<MetricDimension>) customizedMetricSpecification.getDimensions()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<MetricDimension> dimensionsList = (com.amazonaws.internal.SdkInternalList<MetricDimension>) customizedMetricSpecification .getDimensions(); int dimensionsListIndex = 1; if (customizedMetricSpecification.getStatistic() != null) { request.addParameter("TargetTrackingConfiguration.CustomizedMetricSpecification.Statistic", StringUtils.fromString(customizedMetricSpecification.getStatistic())); if (customizedMetricSpecification.getUnit() != null) { request.addParameter("TargetTrackingConfiguration.CustomizedMetricSpecification.Unit", StringUtils.fromString(customizedMetricSpecification.getUnit()));
CustomizedMetricSpecification other = (CustomizedMetricSpecification) obj; if (other.getMetricName() == null ^ this.getMetricName() == null) return false; if (other.getMetricName() != null && other.getMetricName().equals(this.getMetricName()) == false) return false; if (other.getNamespace() == null ^ this.getNamespace() == null) return false; if (other.getNamespace() != null && other.getNamespace().equals(this.getNamespace()) == false) return false; if (other.getDimensions() == null ^ this.getDimensions() == null) return false; if (other.getDimensions() != null && other.getDimensions().equals(this.getDimensions()) == false) return false; if (other.getStatistic() == null ^ this.getStatistic() == null) return false; if (other.getStatistic() != null && other.getStatistic().equals(this.getStatistic()) == false) return false; if (other.getUnit() == null ^ this.getUnit() == null) return false; if (other.getUnit() != null && other.getUnit().equals(this.getUnit()) == 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 (getMetricName() != null) sb.append("MetricName: " + getMetricName() + ","); if (getNamespace() != null) sb.append("Namespace: " + getNamespace() + ","); if (getDimensions() != null) sb.append("Dimensions: " + getDimensions() + ","); if (getStatistic() != null) sb.append("Statistic: " + getStatistic() + ","); if (getUnit() != null) sb.append("Unit: " + getUnit()); sb.append("}"); return sb.toString(); }
public void marshall(CustomizedMetricSpecification _customizedMetricSpecification, Request<?> request, String _prefix) { String prefix; if (_customizedMetricSpecification.getMetricName() != null) { prefix = _prefix + "MetricName"; String metricName = _customizedMetricSpecification.getMetricName(); request.addParameter(prefix, StringUtils.fromString(metricName)); if (_customizedMetricSpecification.getNamespace() != null) { prefix = _prefix + "Namespace"; String namespace = _customizedMetricSpecification.getNamespace(); request.addParameter(prefix, StringUtils.fromString(namespace)); if (_customizedMetricSpecification.getDimensions() != null) { prefix = _prefix + "Dimensions"; java.util.List<MetricDimension> dimensions = _customizedMetricSpecification .getDimensions(); int dimensionsIndex = 1; String dimensionsPrefix = prefix; if (_customizedMetricSpecification.getStatistic() != null) { prefix = _prefix + "Statistic"; String statistic = _customizedMetricSpecification.getStatistic(); request.addParameter(prefix, StringUtils.fromString(statistic)); if (_customizedMetricSpecification.getUnit() != null) { prefix = _prefix + "Unit"; String unit = _customizedMetricSpecification.getUnit(); request.addParameter(prefix, StringUtils.fromString(unit));