@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 EnableAlarmActionsRequest 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: EnableAlarmActions <alarm-name>\n"; if (args.length != 1) { System.out.println(USAGE); System.exit(1); } String alarm = args[0]; final AmazonCloudWatch cw = AmazonCloudWatchClientBuilder.defaultClient(); EnableAlarmActionsRequest request = new EnableAlarmActionsRequest() .withAlarmNames(alarm); EnableAlarmActionsResult response = cw.enableAlarmActions(request); System.out.printf( "Successfully enabled actions on alarm %s", alarm); } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof EnableAlarmActionsRequest == false) return false; EnableAlarmActionsRequest other = (EnableAlarmActionsRequest) 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 EnableAlarmActionsRequest 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 enable 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 enable actions for. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public EnableAlarmActionsRequest withAlarmNames(java.util.Collection<String> alarmNames) { setAlarmNames(alarmNames); return this; }
public Request<EnableAlarmActionsRequest> marshall(EnableAlarmActionsRequest enableAlarmActionsRequest) { if (enableAlarmActionsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<EnableAlarmActionsRequest> request = new DefaultRequest<EnableAlarmActionsRequest>(enableAlarmActionsRequest, "AmazonCloudWatch"); request.addParameter("Action", "EnableAlarmActions"); request.addParameter("Version", "2010-08-01"); request.setHttpMethod(HttpMethodName.POST); if (!enableAlarmActionsRequest.getAlarmNames().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) enableAlarmActionsRequest.getAlarmNames()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<String> alarmNamesList = (com.amazonaws.internal.SdkInternalList<String>) enableAlarmActionsRequest .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 EnableAlarmActionsRequest == false) return false; EnableAlarmActionsRequest other = (EnableAlarmActionsRequest) 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 enable 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 enable actions for. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public EnableAlarmActionsRequest 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 (enableAlarmActionsRequest.getAlarmNames() != null) { prefix = "AlarmNames"; java.util.List<String> alarmNames = enableAlarmActionsRequest.getAlarmNames(); int alarmNamesIndex = 1; String alarmNamesPrefix = prefix;