/** * <p> * The name of the filter. The valid values are: <code>"auto-scaling-group"</code>, <code>"key"</code>, * <code>"value"</code>, and <code>"propagate-at-launch"</code>. * </p> * * @param name * The name of the filter. The valid values are: <code>"auto-scaling-group"</code>, <code>"key"</code>, * <code>"value"</code>, and <code>"propagate-at-launch"</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public Filter withName(String name) { setName(name); return this; }
/** * <p> * The value of the filter. * </p> * * @param values * The value of the filter. * @return Returns a reference to this object so that method calls can be chained together. */ public Filter withValues(java.util.Collection<String> values) { setValues(values); return this; }
public Filter unmarshall(StaxUnmarshallerContext context) throws Exception { Filter filter = new Filter(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return filter; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Name", targetDepth)) { filter.setName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Values", targetDepth)) { filter.withValues(new ArrayList<String>()); continue; } if (context.testExpression("Values/member", targetDepth)) { filter.withValues(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return filter; } } } }
public Map<String, String> getDeployTags() { Map<String, String> tags = new HashMap<>(3); Optional<AutoScalingInstanceDetails> details = describeInstance(); details.ifPresent(autoScalingInstanceDetails -> { autoScalingInstanceDetails.getAutoScalingGroupName(); List<Filter> filters = Collections.singletonList( new Filter().withName("auto-scaling-group").withValues(autoScalingInstanceDetails.getAutoScalingGroupName()) ); DescribeTagsResult result = asyncClient.describeTags(new DescribeTagsRequest().withFilters(filters)); result.getTags().forEach(t -> tags.put(t.getKey(), t.getValue())); }); return tags; }
/** * <p> * The value of the filter. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param values <p> * The value of the filter. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public Filter withValues(String... values) { if (getValues() == null) { this.values = new java.util.ArrayList<String>(values.length); } for (String value : values) { this.values.add(value); } return this; }
public Filter unmarshall(StaxUnmarshallerContext context) throws Exception { Filter filter = new Filter(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) break; if (xmlEvent == XmlPullParser.START_TAG) { if (context.testExpression("Name", targetDepth)) { filter.setName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Values/member", targetDepth)) { filter.withValues(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { break; } } } return filter; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Filter == false) return false; Filter other = (Filter) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getValues() == null ^ this.getValues() == null) return false; if (other.getValues() != null && other.getValues().equals(this.getValues()) == false) return false; return true; }
/** * <p> * The value of the filter. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setValues(java.util.Collection)} or {@link #withValues(java.util.Collection)} if you want to override the * existing values. * </p> * * @param values * The value of the filter. * @return Returns a reference to this object so that method calls can be chained together. */ public Filter withValues(String... values) { if (this.values == null) { setValues(new com.amazonaws.internal.SdkInternalList<String>(values.length)); } for (String ele : values) { this.values.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 (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getValues() != null) sb.append("Values: ").append(getValues()); sb.append("}"); return sb.toString(); }
/** * <p> * The value of the filter. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param values <p> * The value of the filter. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public Filter withValues(java.util.Collection<String> values) { setValues(values); return this; }
if (filtersListValue.getName() != null) { request.addParameter("Filters.member." + filtersListIndex + ".Name", StringUtils.fromString(filtersListValue.getName())); if (!filtersListValue.getValues().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) filtersListValue.getValues()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<String> valuesList = (com.amazonaws.internal.SdkInternalList<String>) filtersListValue.getValues(); int valuesListIndex = 1;
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Filter == false) return false; Filter other = (Filter) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getValues() == null ^ this.getValues() == null) return false; if (other.getValues() != null && other.getValues().equals(this.getValues()) == 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 (getName() != null) sb.append("Name: " + getName() + ","); if (getValues() != null) sb.append("Values: " + getValues()); sb.append("}"); return sb.toString(); }
public void marshall(Filter _filter, Request<?> request, String _prefix) { String prefix; if (_filter.getName() != null) { prefix = _prefix + "Name"; String name = _filter.getName(); request.addParameter(prefix, StringUtils.fromString(name)); } if (_filter.getValues() != null) { prefix = _prefix + "Values"; java.util.List<String> values = _filter.getValues(); int valuesIndex = 1; String valuesPrefix = prefix; for (String valuesItem : values) { prefix = valuesPrefix + ".member." + valuesIndex; if (valuesItem != null) { request.addParameter(prefix, StringUtils.fromString(valuesItem)); } valuesIndex++; } prefix = valuesPrefix; } }