@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAlarmNames() == null) ? 0 : getAlarmNames().hashCode()); return hashCode; }
/** * <p> * The names of the alarms. * </p> * * @param alarmNames * The names of the alarms. * @return Returns a reference to this object so that method calls can be chained together. */ public DisableAlarmActionsRequest withAlarmNames(java.util.Collection<String> alarmNames) { setAlarmNames(alarmNames); return this; }
public static void main(String[] args) { final String USAGE = "To run this example, supply an alarm name\n" + "Ex: DisableAlarmActions <alarm-name>\n"; if (args.length != 1) { System.out.println(USAGE); System.exit(1); } String alarmName = args[0]; final AmazonCloudWatch cw = AmazonCloudWatchClientBuilder.defaultClient(); DisableAlarmActionsRequest request = new DisableAlarmActionsRequest() .withAlarmNames(alarmName); DisableAlarmActionsResult response = cw.disableAlarmActions(request); System.out.printf( "Successfully disabled actions on alarm %s", alarmName); } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DisableAlarmActionsRequest == false) return false; DisableAlarmActionsRequest other = (DisableAlarmActionsRequest) obj; if (other.getAlarmNames() == null ^ this.getAlarmNames() == null) return false; if (other.getAlarmNames() != null && other.getAlarmNames().equals(this.getAlarmNames()) == false) return false; return true; }
/** * <p> * The names of the alarms. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setAlarmNames(java.util.Collection)} or {@link #withAlarmNames(java.util.Collection)} if you want to * override the existing values. * </p> * * @param alarmNames * The names of the alarms. * @return Returns a reference to this object so that method calls can be chained together. */ public DisableAlarmActionsRequest withAlarmNames(String... alarmNames) { if (this.alarmNames == null) { setAlarmNames(new com.amazonaws.internal.SdkInternalList<String>(alarmNames.length)); } for (String ele : alarmNames) { this.alarmNames.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 (getAlarmNames() != null) sb.append("AlarmNames: ").append(getAlarmNames()); sb.append("}"); return sb.toString(); }
/** * <p> * The names of the alarms to disable actions for. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param alarmNames <p> * The names of the alarms to disable actions for. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public DisableAlarmActionsRequest withAlarmNames(java.util.Collection<String> alarmNames) { setAlarmNames(alarmNames); return this; }
public Request<DisableAlarmActionsRequest> marshall(DisableAlarmActionsRequest disableAlarmActionsRequest) { if (disableAlarmActionsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<DisableAlarmActionsRequest> request = new DefaultRequest<DisableAlarmActionsRequest>(disableAlarmActionsRequest, "AmazonCloudWatch"); request.addParameter("Action", "DisableAlarmActions"); request.addParameter("Version", "2010-08-01"); request.setHttpMethod(HttpMethodName.POST); if (!disableAlarmActionsRequest.getAlarmNames().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) disableAlarmActionsRequest.getAlarmNames()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<String> alarmNamesList = (com.amazonaws.internal.SdkInternalList<String>) disableAlarmActionsRequest .getAlarmNames(); int alarmNamesListIndex = 1; for (String alarmNamesListValue : alarmNamesList) { if (alarmNamesListValue != null) { request.addParameter("AlarmNames.member." + alarmNamesListIndex, StringUtils.fromString(alarmNamesListValue)); } alarmNamesListIndex++; } } return request; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAlarmNames() == null) ? 0 : getAlarmNames().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DisableAlarmActionsRequest == false) return false; DisableAlarmActionsRequest other = (DisableAlarmActionsRequest) obj; if (other.getAlarmNames() == null ^ this.getAlarmNames() == null) return false; if (other.getAlarmNames() != null && other.getAlarmNames().equals(this.getAlarmNames()) == 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 (getAlarmNames() != null) sb.append("AlarmNames: " + getAlarmNames()); sb.append("}"); return sb.toString(); }
/** * <p> * The names of the alarms to disable actions for. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param alarmNames <p> * The names of the alarms to disable actions for. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public DisableAlarmActionsRequest withAlarmNames(String... alarmNames) { if (getAlarmNames() == null) { this.alarmNames = new java.util.ArrayList<String>(alarmNames.length); } for (String value : alarmNames) { this.alarmNames.add(value); } return this; }
if (disableAlarmActionsRequest.getAlarmNames() != null) { prefix = "AlarmNames"; java.util.List<String> alarmNames = disableAlarmActionsRequest.getAlarmNames(); int alarmNamesIndex = 1; String alarmNamesPrefix = prefix;