@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getOnDemandAllocationStrategy() == null) ? 0 : getOnDemandAllocationStrategy().hashCode()); hashCode = prime * hashCode + ((getOnDemandBaseCapacity() == null) ? 0 : getOnDemandBaseCapacity().hashCode()); hashCode = prime * hashCode + ((getOnDemandPercentageAboveBaseCapacity() == null) ? 0 : getOnDemandPercentageAboveBaseCapacity().hashCode()); hashCode = prime * hashCode + ((getSpotAllocationStrategy() == null) ? 0 : getSpotAllocationStrategy().hashCode()); hashCode = prime * hashCode + ((getSpotInstancePools() == null) ? 0 : getSpotInstancePools().hashCode()); hashCode = prime * hashCode + ((getSpotMaxPrice() == null) ? 0 : getSpotMaxPrice().hashCode()); return hashCode; }
/** * <p> * Indicates how to allocate instance types to fulfill On-Demand capacity. * </p> * <p> * The only valid value is <code>prioritized</code>, which is also the default value. This strategy uses the order * of instance types in the <b>Overrides</b> array of <a>LaunchTemplate</a> to define the launch priority of each * instance type. The first instance type in the array is prioritized higher than the last. If all your On-Demand * capacity cannot be fulfilled using your highest priority instance, then the Auto Scaling groups launches the * remaining capacity using the second priority instance type, and so on. * </p> * * @param onDemandAllocationStrategy * Indicates how to allocate instance types to fulfill On-Demand capacity. </p> * <p> * The only valid value is <code>prioritized</code>, which is also the default value. This strategy uses the * order of instance types in the <b>Overrides</b> array of <a>LaunchTemplate</a> to define the launch * priority of each instance type. The first instance type in the array is prioritized higher than the last. * If all your On-Demand capacity cannot be fulfilled using your highest priority instance, then the Auto * Scaling groups launches the remaining capacity using the second priority instance type, and so on. * @return Returns a reference to this object so that method calls can be chained together. */ public InstancesDistribution withOnDemandAllocationStrategy(String onDemandAllocationStrategy) { setOnDemandAllocationStrategy(onDemandAllocationStrategy); return this; }
public InstancesDistribution unmarshall(StaxUnmarshallerContext context) throws Exception { InstancesDistribution instancesDistribution = new InstancesDistribution(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; instancesDistribution.setOnDemandAllocationStrategy(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; instancesDistribution.setOnDemandBaseCapacity(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; instancesDistribution.setOnDemandPercentageAboveBaseCapacity(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; instancesDistribution.setSpotAllocationStrategy(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; instancesDistribution.setSpotInstancePools(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; instancesDistribution.setSpotMaxPrice(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue;
@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; }
public InstancesDistribution unmarshall(StaxUnmarshallerContext context) throws Exception { InstancesDistribution instancesDistribution = new InstancesDistribution(); instancesDistribution.setOnDemandAllocationStrategy(StringStaxUnmarshaller .getInstance().unmarshall(context)); continue; instancesDistribution.setOnDemandBaseCapacity(IntegerStaxUnmarshaller .getInstance().unmarshall(context)); continue; .setOnDemandPercentageAboveBaseCapacity(IntegerStaxUnmarshaller .getInstance().unmarshall(context)); continue; instancesDistribution.setSpotAllocationStrategy(StringStaxUnmarshaller .getInstance().unmarshall(context)); continue; instancesDistribution.setSpotInstancePools(IntegerStaxUnmarshaller .getInstance().unmarshall(context)); continue; instancesDistribution.setSpotMaxPrice(StringStaxUnmarshaller.getInstance() .unmarshall(context)); continue;
@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; } }
return false; InstancesDistribution other = (InstancesDistribution) obj; if (other.getOnDemandAllocationStrategy() == null ^ this.getOnDemandAllocationStrategy() == null) return false; if (other.getOnDemandAllocationStrategy() != null && other.getOnDemandAllocationStrategy().equals(this.getOnDemandAllocationStrategy()) == false) return false; if (other.getOnDemandBaseCapacity() == null ^ this.getOnDemandBaseCapacity() == null) return false; if (other.getOnDemandBaseCapacity() != null && other.getOnDemandBaseCapacity().equals(this.getOnDemandBaseCapacity()) == false) return false; if (other.getOnDemandPercentageAboveBaseCapacity() == null ^ this.getOnDemandPercentageAboveBaseCapacity() == null) return false; if (other.getOnDemandPercentageAboveBaseCapacity() != null && other.getOnDemandPercentageAboveBaseCapacity().equals(this.getOnDemandPercentageAboveBaseCapacity()) == false) return false; if (other.getSpotAllocationStrategy() == null ^ this.getSpotAllocationStrategy() == null) return false; if (other.getSpotAllocationStrategy() != null && other.getSpotAllocationStrategy().equals(this.getSpotAllocationStrategy()) == false) return false; if (other.getSpotInstancePools() == null ^ this.getSpotInstancePools() == null) return false; if (other.getSpotInstancePools() != null && other.getSpotInstancePools().equals(this.getSpotInstancePools()) == false) return false; if (other.getSpotMaxPrice() == null ^ this.getSpotMaxPrice() == null) return false; if (other.getSpotMaxPrice() != null && other.getSpotMaxPrice().equals(this.getSpotMaxPrice()) == false) return false; return true;
/** * 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 (getOnDemandAllocationStrategy() != null) sb.append("OnDemandAllocationStrategy: ").append(getOnDemandAllocationStrategy()).append(","); if (getOnDemandBaseCapacity() != null) sb.append("OnDemandBaseCapacity: ").append(getOnDemandBaseCapacity()).append(","); if (getOnDemandPercentageAboveBaseCapacity() != null) sb.append("OnDemandPercentageAboveBaseCapacity: ").append(getOnDemandPercentageAboveBaseCapacity()).append(","); if (getSpotAllocationStrategy() != null) sb.append("SpotAllocationStrategy: ").append(getSpotAllocationStrategy()).append(","); if (getSpotInstancePools() != null) sb.append("SpotInstancePools: ").append(getSpotInstancePools()).append(","); if (getSpotMaxPrice() != null) sb.append("SpotMaxPrice: ").append(getSpotMaxPrice()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getOnDemandAllocationStrategy() == null) ? 0 : getOnDemandAllocationStrategy() .hashCode()); hashCode = prime * hashCode + ((getOnDemandBaseCapacity() == null) ? 0 : getOnDemandBaseCapacity().hashCode()); hashCode = prime * hashCode + ((getOnDemandPercentageAboveBaseCapacity() == null) ? 0 : getOnDemandPercentageAboveBaseCapacity().hashCode()); hashCode = prime * hashCode + ((getSpotAllocationStrategy() == null) ? 0 : getSpotAllocationStrategy() .hashCode()); hashCode = prime * hashCode + ((getSpotInstancePools() == null) ? 0 : getSpotInstancePools().hashCode()); hashCode = prime * hashCode + ((getSpotMaxPrice() == null) ? 0 : getSpotMaxPrice().hashCode()); return hashCode; }
if (instancesDistribution != null) { if (instancesDistribution.getOnDemandAllocationStrategy() != null) { request.addParameter("MixedInstancesPolicy.InstancesDistribution.OnDemandAllocationStrategy", StringUtils.fromString(instancesDistribution.getOnDemandAllocationStrategy())); if (instancesDistribution.getOnDemandBaseCapacity() != null) { request.addParameter("MixedInstancesPolicy.InstancesDistribution.OnDemandBaseCapacity", StringUtils.fromInteger(instancesDistribution.getOnDemandBaseCapacity())); if (instancesDistribution.getOnDemandPercentageAboveBaseCapacity() != null) { request.addParameter("MixedInstancesPolicy.InstancesDistribution.OnDemandPercentageAboveBaseCapacity", StringUtils.fromInteger(instancesDistribution.getOnDemandPercentageAboveBaseCapacity())); if (instancesDistribution.getSpotAllocationStrategy() != null) { request.addParameter("MixedInstancesPolicy.InstancesDistribution.SpotAllocationStrategy", StringUtils.fromString(instancesDistribution.getSpotAllocationStrategy())); if (instancesDistribution.getSpotInstancePools() != null) { request.addParameter("MixedInstancesPolicy.InstancesDistribution.SpotInstancePools", StringUtils.fromInteger(instancesDistribution.getSpotInstancePools())); if (instancesDistribution.getSpotMaxPrice() != null) { request.addParameter("MixedInstancesPolicy.InstancesDistribution.SpotMaxPrice", StringUtils.fromString(instancesDistribution.getSpotMaxPrice()));
/** * 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 (getOnDemandAllocationStrategy() != null) sb.append("OnDemandAllocationStrategy: " + getOnDemandAllocationStrategy() + ","); if (getOnDemandBaseCapacity() != null) sb.append("OnDemandBaseCapacity: " + getOnDemandBaseCapacity() + ","); if (getOnDemandPercentageAboveBaseCapacity() != null) sb.append("OnDemandPercentageAboveBaseCapacity: " + getOnDemandPercentageAboveBaseCapacity() + ","); if (getSpotAllocationStrategy() != null) sb.append("SpotAllocationStrategy: " + getSpotAllocationStrategy() + ","); if (getSpotInstancePools() != null) sb.append("SpotInstancePools: " + getSpotInstancePools() + ","); if (getSpotMaxPrice() != null) sb.append("SpotMaxPrice: " + getSpotMaxPrice()); sb.append("}"); return sb.toString(); }
if (other.getOnDemandAllocationStrategy() == null ^ this.getOnDemandAllocationStrategy() == null) return false; if (other.getOnDemandAllocationStrategy() != null && other.getOnDemandAllocationStrategy().equals( this.getOnDemandAllocationStrategy()) == false) return false; if (other.getOnDemandBaseCapacity() == null ^ this.getOnDemandBaseCapacity() == null) return false; if (other.getOnDemandBaseCapacity() != null && other.getOnDemandBaseCapacity().equals(this.getOnDemandBaseCapacity()) == false) return false; if (other.getOnDemandPercentageAboveBaseCapacity() == null ^ this.getOnDemandPercentageAboveBaseCapacity() == null) return false; if (other.getOnDemandPercentageAboveBaseCapacity() != null && other.getOnDemandPercentageAboveBaseCapacity().equals( this.getOnDemandPercentageAboveBaseCapacity()) == false) return false; if (other.getSpotAllocationStrategy() == null ^ this.getSpotAllocationStrategy() == null) return false; if (other.getSpotAllocationStrategy() != null && other.getSpotAllocationStrategy().equals(this.getSpotAllocationStrategy()) == false) return false; if (other.getSpotInstancePools() == null ^ this.getSpotInstancePools() == null) return false; if (other.getSpotInstancePools() != null && other.getSpotInstancePools().equals(this.getSpotInstancePools()) == false) return false;
if (instancesDistribution != null) { if (instancesDistribution.getOnDemandAllocationStrategy() != null) { request.addParameter("MixedInstancesPolicy.InstancesDistribution.OnDemandAllocationStrategy", StringUtils.fromString(instancesDistribution.getOnDemandAllocationStrategy())); if (instancesDistribution.getOnDemandBaseCapacity() != null) { request.addParameter("MixedInstancesPolicy.InstancesDistribution.OnDemandBaseCapacity", StringUtils.fromInteger(instancesDistribution.getOnDemandBaseCapacity())); if (instancesDistribution.getOnDemandPercentageAboveBaseCapacity() != null) { request.addParameter("MixedInstancesPolicy.InstancesDistribution.OnDemandPercentageAboveBaseCapacity", StringUtils.fromInteger(instancesDistribution.getOnDemandPercentageAboveBaseCapacity())); if (instancesDistribution.getSpotAllocationStrategy() != null) { request.addParameter("MixedInstancesPolicy.InstancesDistribution.SpotAllocationStrategy", StringUtils.fromString(instancesDistribution.getSpotAllocationStrategy())); if (instancesDistribution.getSpotInstancePools() != null) { request.addParameter("MixedInstancesPolicy.InstancesDistribution.SpotInstancePools", StringUtils.fromInteger(instancesDistribution.getSpotInstancePools())); if (instancesDistribution.getSpotMaxPrice() != null) { request.addParameter("MixedInstancesPolicy.InstancesDistribution.SpotMaxPrice", StringUtils.fromString(instancesDistribution.getSpotMaxPrice()));
public void marshall(InstancesDistribution _instancesDistribution, Request<?> request, String _prefix) { String prefix; if (_instancesDistribution.getOnDemandAllocationStrategy() != null) { prefix = _prefix + "OnDemandAllocationStrategy"; String onDemandAllocationStrategy = _instancesDistribution .getOnDemandAllocationStrategy(); request.addParameter(prefix, StringUtils.fromString(onDemandAllocationStrategy)); if (_instancesDistribution.getOnDemandBaseCapacity() != null) { prefix = _prefix + "OnDemandBaseCapacity"; Integer onDemandBaseCapacity = _instancesDistribution.getOnDemandBaseCapacity(); request.addParameter(prefix, StringUtils.fromInteger(onDemandBaseCapacity)); if (_instancesDistribution.getOnDemandPercentageAboveBaseCapacity() != null) { prefix = _prefix + "OnDemandPercentageAboveBaseCapacity"; Integer onDemandPercentageAboveBaseCapacity = _instancesDistribution .getOnDemandPercentageAboveBaseCapacity(); request.addParameter(prefix, StringUtils.fromInteger(onDemandPercentageAboveBaseCapacity)); if (_instancesDistribution.getSpotAllocationStrategy() != null) { prefix = _prefix + "SpotAllocationStrategy"; String spotAllocationStrategy = _instancesDistribution.getSpotAllocationStrategy(); request.addParameter(prefix, StringUtils.fromString(spotAllocationStrategy)); if (_instancesDistribution.getSpotInstancePools() != null) { prefix = _prefix + "SpotInstancePools"; Integer spotInstancePools = _instancesDistribution.getSpotInstancePools(); request.addParameter(prefix, StringUtils.fromInteger(spotInstancePools));