@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLaunchConfigurations() == null) ? 0 : getLaunchConfigurations().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); return hashCode; }
/** * <p> * The launch configurations. * </p> * * @param launchConfigurations * The launch configurations. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeLaunchConfigurationsResult withLaunchConfigurations(java.util.Collection<LaunchConfiguration> launchConfigurations) { setLaunchConfigurations(launchConfigurations); return this; }
/** * <p> * The token to use when requesting the next set of items. If there are no additional items to return, the string is * empty. * </p> * * @param nextToken * The token to use when requesting the next set of items. If there are no additional items to return, the * string is empty. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeLaunchConfigurationsResult withNextToken(String nextToken) { setNextToken(nextToken); return this; }
public DescribeLaunchConfigurationsResult unmarshall(StaxUnmarshallerContext context) throws Exception { DescribeLaunchConfigurationsResult describeLaunchConfigurationsResult = new DescribeLaunchConfigurationsResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return describeLaunchConfigurationsResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("LaunchConfigurations", targetDepth)) { describeLaunchConfigurationsResult.withLaunchConfigurations(new ArrayList<LaunchConfiguration>()); continue; } if (context.testExpression("LaunchConfigurations/member", targetDepth)) { describeLaunchConfigurationsResult.withLaunchConfigurations(LaunchConfigurationStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("NextToken", targetDepth)) { describeLaunchConfigurationsResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return describeLaunchConfigurationsResult; } } } }
public DescribeLaunchConfigurationsResult describeLaunchConfigurations(DescribeLaunchConfigurationsRequest request) { return new DescribeLaunchConfigurationsResult() .withLaunchConfigurations( describe(request, "launchConfigurationNames", "launchConfigurations", LaunchConfiguration.class)); }
/** * <p> * The launch configurations. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param launchConfigurations <p> * The launch configurations. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public DescribeLaunchConfigurationsResult withLaunchConfigurations( LaunchConfiguration... launchConfigurations) { if (getLaunchConfigurations() == null) { this.launchConfigurations = new java.util.ArrayList<LaunchConfiguration>( launchConfigurations.length); } for (LaunchConfiguration value : launchConfigurations) { this.launchConfigurations.add(value); } return this; }
public DescribeLaunchConfigurationsResult unmarshall(StaxUnmarshallerContext context) throws Exception { DescribeLaunchConfigurationsResult describeLaunchConfigurationsResult = new DescribeLaunchConfigurationsResult(); if (context.testExpression("LaunchConfigurations/member", targetDepth)) { describeLaunchConfigurationsResult .withLaunchConfigurations(LaunchConfigurationStaxUnmarshaller .getInstance().unmarshall(context)); continue; describeLaunchConfigurationsResult.setNextToken(StringStaxUnmarshaller .getInstance().unmarshall(context)); continue;
public DescribeLaunchConfigurationsResult describeLaunchConfigurations(DescribeLaunchConfigurationsRequest request) { return new DescribeLaunchConfigurationsResult().withLaunchConfigurations(describe(request, "launchConfigurationNames", "launchConfigurations", LaunchConfiguration.class, new TypeReference<List<LaunchConfiguration>>() { })); }
@Override public LaunchConfiguration call() { DescribeLaunchConfigurationsRequest request = new DescribeLaunchConfigurationsRequest() .withLaunchConfigurationNames(this.launchConfigurationName); DescribeLaunchConfigurationsResult result = getClient().getApi().describeLaunchConfigurations(request); List<LaunchConfiguration> launchConfigurations = result.getLaunchConfigurations(); if (launchConfigurations.isEmpty()) { throw new IllegalArgumentException(format("Launch Configuration '%s' doesn't exist in region '%s'.", this.launchConfigurationName, getClient().getRegion())); } return getOnlyElement(launchConfigurations); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeLaunchConfigurationsResult == false) return false; DescribeLaunchConfigurationsResult other = (DescribeLaunchConfigurationsResult) obj; if (other.getLaunchConfigurations() == null ^ this.getLaunchConfigurations() == null) return false; if (other.getLaunchConfigurations() != null && other.getLaunchConfigurations().equals(this.getLaunchConfigurations()) == false) return false; if (other.getNextToken() == null ^ this.getNextToken() == null) return false; if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false) return false; return true; }
launchConfigurationNamesTemp.add(launchConfigurationNames.get(i)); if((i+1)%50==0 || i == launchConfigurationNames.size()-1){ launchConfigurationListTemp.addAll(asgClient.describeLaunchConfigurations(new DescribeLaunchConfigurationsRequest().withLaunchConfigurationNames(launchConfigurationNamesTemp)).getLaunchConfigurations()); launchConfigurationNamesTemp = new ArrayList<>();
/** * <p> * The launch configurations. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setLaunchConfigurations(java.util.Collection)} or {@link #withLaunchConfigurations(java.util.Collection)} * if you want to override the existing values. * </p> * * @param launchConfigurations * The launch configurations. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeLaunchConfigurationsResult withLaunchConfigurations(LaunchConfiguration... launchConfigurations) { if (this.launchConfigurations == null) { setLaunchConfigurations(new com.amazonaws.internal.SdkInternalList<LaunchConfiguration>(launchConfigurations.length)); } for (LaunchConfiguration ele : launchConfigurations) { this.launchConfigurations.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 (getLaunchConfigurations() != null) sb.append("LaunchConfigurations: ").append(getLaunchConfigurations()).append(","); if (getNextToken() != null) sb.append("NextToken: ").append(getNextToken()); sb.append("}"); return sb.toString(); }
/** * <p> * The launch configurations. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param launchConfigurations <p> * The launch configurations. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public DescribeLaunchConfigurationsResult withLaunchConfigurations( java.util.Collection<LaunchConfiguration> launchConfigurations) { setLaunchConfigurations(launchConfigurations); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLaunchConfigurations() == null) ? 0 : getLaunchConfigurations().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeLaunchConfigurationsResult == false) return false; DescribeLaunchConfigurationsResult other = (DescribeLaunchConfigurationsResult) obj; if (other.getLaunchConfigurations() == null ^ this.getLaunchConfigurations() == null) return false; if (other.getLaunchConfigurations() != null && other.getLaunchConfigurations().equals(this.getLaunchConfigurations()) == false) return false; if (other.getNextToken() == null ^ this.getNextToken() == null) return false; if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == 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 (getLaunchConfigurations() != null) sb.append("LaunchConfigurations: " + getLaunchConfigurations() + ","); if (getNextToken() != null) sb.append("NextToken: " + getNextToken()); sb.append("}"); return sb.toString(); }
private void forEachLaunchConfig(Region region, Consumer<LaunchConfiguration> consumer) { DescribeLaunchConfigurationsResult results = getClient() .describeLaunchConfigurations(new DescribeLaunchConfigurationsRequest()); rateLimit(); String token = results.getNextToken(); results.getLaunchConfigurations().forEach(consumer); while (tokenHasNext(token)) { rateLimit(); results = getClient() .describeLaunchConfigurations(new DescribeLaunchConfigurationsRequest().withNextToken(token)); token = results.getNextToken(); results.getLaunchConfigurations().forEach(consumer); } }