@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLaunchTemplateSpecification() == null) ? 0 : getLaunchTemplateSpecification().hashCode()); hashCode = prime * hashCode + ((getOverrides() == null) ? 0 : getOverrides().hashCode()); return hashCode; }
/** * <p> * The launch template to use. You must specify either the launch template ID or launch template name in the * request. * </p> * * @param launchTemplateSpecification * The launch template to use. You must specify either the launch template ID or launch template name in the * request. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchTemplate withLaunchTemplateSpecification(LaunchTemplateSpecification launchTemplateSpecification) { setLaunchTemplateSpecification(launchTemplateSpecification); return this; }
/** * <p> * Any parameters that you specify override the same parameters in the launch template. Currently, the only * supported override is instance type. * </p> * <p> * You must specify between 2 and 20 overrides. * </p> * * @param overrides * Any parameters that you specify override the same parameters in the launch template. Currently, the only * supported override is instance type. </p> * <p> * You must specify between 2 and 20 overrides. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchTemplate withOverrides(java.util.Collection<LaunchTemplateOverrides> overrides) { setOverrides(overrides); return this; }
public LaunchTemplate unmarshall(StaxUnmarshallerContext context) throws Exception { LaunchTemplate launchTemplate = new LaunchTemplate(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return launchTemplate; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("LaunchTemplateSpecification", targetDepth)) { launchTemplate.setLaunchTemplateSpecification(LaunchTemplateSpecificationStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Overrides", targetDepth)) { launchTemplate.withOverrides(new ArrayList<LaunchTemplateOverrides>()); continue; } if (context.testExpression("Overrides/member", targetDepth)) { launchTemplate.withOverrides(LaunchTemplateOverridesStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return launchTemplate; } } } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLaunchTemplate() == null) ? 0 : getLaunchTemplate().hashCode()); hashCode = prime * hashCode + ((getInstancesDistribution() == null) ? 0 : getInstancesDistribution().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof MixedInstancesPolicy == false) return false; MixedInstancesPolicy other = (MixedInstancesPolicy) obj; if (other.getLaunchTemplate() == null ^ this.getLaunchTemplate() == null) return false; if (other.getLaunchTemplate() != null && other.getLaunchTemplate().equals(this.getLaunchTemplate()) == false) return false; if (other.getInstancesDistribution() == null ^ this.getInstancesDistribution() == null) return false; if (other.getInstancesDistribution() != null && other.getInstancesDistribution().equals(this.getInstancesDistribution()) == false) return false; return true; }
if (getOverrides() == null) { this.overrides = new java.util.ArrayList<LaunchTemplateOverrides>(overrides.length);
public LaunchTemplate unmarshall(StaxUnmarshallerContext context) throws Exception { LaunchTemplate launchTemplate = new LaunchTemplate(); 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("LaunchTemplateSpecification", targetDepth)) { launchTemplate .setLaunchTemplateSpecification(LaunchTemplateSpecificationStaxUnmarshaller .getInstance().unmarshall(context)); continue; } if (context.testExpression("Overrides/member", targetDepth)) { launchTemplate.withOverrides(LaunchTemplateOverridesStaxUnmarshaller .getInstance().unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { break; } } } return launchTemplate; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLaunchTemplate() == null) ? 0 : getLaunchTemplate().hashCode()); hashCode = prime * hashCode + ((getInstancesDistribution() == null) ? 0 : getInstancesDistribution().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof MixedInstancesPolicy == false) return false; MixedInstancesPolicy other = (MixedInstancesPolicy) obj; if (other.getLaunchTemplate() == null ^ this.getLaunchTemplate() == null) return false; if (other.getLaunchTemplate() != null && other.getLaunchTemplate().equals(this.getLaunchTemplate()) == false) return false; if (other.getInstancesDistribution() == null ^ this.getInstancesDistribution() == null) return false; if (other.getInstancesDistribution() != null && other.getInstancesDistribution().equals(this.getInstancesDistribution()) == false) return false; return true; } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof LaunchTemplate == false) return false; LaunchTemplate other = (LaunchTemplate) obj; if (other.getLaunchTemplateSpecification() == null ^ this.getLaunchTemplateSpecification() == null) return false; if (other.getLaunchTemplateSpecification() != null && other.getLaunchTemplateSpecification().equals(this.getLaunchTemplateSpecification()) == false) return false; if (other.getOverrides() == null ^ this.getOverrides() == null) return false; if (other.getOverrides() != null && other.getOverrides().equals(this.getOverrides()) == false) return false; return true; }
/** * <p> * Any parameters that you specify override the same parameters in the launch template. Currently, the only * supported override is instance type. * </p> * <p> * You must specify between 2 and 20 overrides. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setOverrides(java.util.Collection)} or {@link #withOverrides(java.util.Collection)} if you want to * override the existing values. * </p> * * @param overrides * Any parameters that you specify override the same parameters in the launch template. Currently, the only * supported override is instance type. </p> * <p> * You must specify between 2 and 20 overrides. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchTemplate withOverrides(LaunchTemplateOverrides... overrides) { if (this.overrides == null) { setOverrides(new com.amazonaws.internal.SdkInternalList<LaunchTemplateOverrides>(overrides.length)); } for (LaunchTemplateOverrides ele : overrides) { this.overrides.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 (getLaunchTemplateSpecification() != null) sb.append("LaunchTemplateSpecification: ").append(getLaunchTemplateSpecification()).append(","); if (getOverrides() != null) sb.append("Overrides: ").append(getOverrides()); sb.append("}"); return sb.toString(); }
/** * <p> * Any parameters that you specify override the same parameters in the * launch template. Currently, the only supported override is instance type. * </p> * <p> * You must specify between 2 and 20 overrides. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param overrides <p> * Any parameters that you specify override the same parameters * in the launch template. Currently, the only supported override * is instance type. * </p> * <p> * You must specify between 2 and 20 overrides. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public LaunchTemplate withOverrides(java.util.Collection<LaunchTemplateOverrides> overrides) { setOverrides(overrides); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLaunchTemplateSpecification() == null) ? 0 : getLaunchTemplateSpecification().hashCode()); hashCode = prime * hashCode + ((getOverrides() == null) ? 0 : getOverrides().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof LaunchTemplate == false) return false; LaunchTemplate other = (LaunchTemplate) obj; if (other.getLaunchTemplateSpecification() == null ^ this.getLaunchTemplateSpecification() == null) return false; if (other.getLaunchTemplateSpecification() != null && other.getLaunchTemplateSpecification().equals( this.getLaunchTemplateSpecification()) == false) return false; if (other.getOverrides() == null ^ this.getOverrides() == null) return false; if (other.getOverrides() != null && other.getOverrides().equals(this.getOverrides()) == 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 (getLaunchTemplateSpecification() != null) sb.append("LaunchTemplateSpecification: " + getLaunchTemplateSpecification() + ","); if (getOverrides() != null) sb.append("Overrides: " + getOverrides()); sb.append("}"); return sb.toString(); }
public void marshall(LaunchTemplate _launchTemplate, Request<?> request, String _prefix) { String prefix; if (_launchTemplate.getLaunchTemplateSpecification() != null) { prefix = _prefix + "LaunchTemplateSpecification"; LaunchTemplateSpecification launchTemplateSpecification = _launchTemplate .getLaunchTemplateSpecification(); LaunchTemplateSpecificationStaxMarshaller.getInstance().marshall( launchTemplateSpecification, request, prefix + "."); } if (_launchTemplate.getOverrides() != null) { prefix = _prefix + "Overrides"; java.util.List<LaunchTemplateOverrides> overrides = _launchTemplate.getOverrides(); int overridesIndex = 1; String overridesPrefix = prefix; for (LaunchTemplateOverrides overridesItem : overrides) { prefix = overridesPrefix + ".member." + overridesIndex; if (overridesItem != null) { LaunchTemplateOverridesStaxMarshaller.getInstance().marshall(overridesItem, request, prefix + "."); } overridesIndex++; } prefix = overridesPrefix; } }
LaunchTemplateSpecification launchTemplateSpecification = launchTemplate.getLaunchTemplateSpecification(); if (launchTemplateSpecification != null) { if (!launchTemplate.getOverrides().isEmpty() || !((com.amazonaws.internal.SdkInternalList<LaunchTemplateOverrides>) launchTemplate.getOverrides()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<LaunchTemplateOverrides> overridesList = (com.amazonaws.internal.SdkInternalList<LaunchTemplateOverrides>) launchTemplate .getOverrides(); int overridesListIndex = 1;
LaunchTemplateSpecification launchTemplateSpecification = launchTemplate.getLaunchTemplateSpecification(); if (launchTemplateSpecification != null) { if (!launchTemplate.getOverrides().isEmpty() || !((com.amazonaws.internal.SdkInternalList<LaunchTemplateOverrides>) launchTemplate.getOverrides()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<LaunchTemplateOverrides> overridesList = (com.amazonaws.internal.SdkInternalList<LaunchTemplateOverrides>) launchTemplate .getOverrides(); int overridesListIndex = 1;