com.amazonaws.services.gamelift.model.ContainerGroupsPerInstance Maven / Gradle / Ivy
Show all versions of aws-java-sdk-gamelift Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.gamelift.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* This data type is used with the Amazon GameLift containers feature, which is currently in public preview.
*
*
* Determines how many replica container groups that Amazon GameLift deploys to each instance in a container fleet.
*
*
* Amazon GameLift calculates the maximum possible replica groups per instance based on the instance 's CPU and memory
* resources. When deploying a fleet, Amazon GameLift places replica container groups on each fleet instance based on
* the following:
*
*
* -
*
* If no desired value is set, Amazon GameLift places the calculated maximum.
*
*
* -
*
* If a desired number is set to a value higher than the calculated maximum, Amazon GameLift places the calculated
* maximum.
*
*
* -
*
* If a desired number is set to a value lower than the calculated maximum, Amazon GameLift places the desired number.
*
*
*
*
* Part of: ContainerGroupsConfiguration, ContainerGroupsAttributes
*
*
* Returned by: DescribeFleetAttributes, CreateFleet
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ContainerGroupsPerInstance implements Serializable, Cloneable, StructuredPojo {
/**
*
* The desired number of replica container groups to place on each fleet instance.
*
*/
private Integer desiredReplicaContainerGroupsPerInstance;
/**
*
* The maximum possible number of replica container groups that each fleet instance can have.
*
*/
private Integer maxReplicaContainerGroupsPerInstance;
/**
*
* The desired number of replica container groups to place on each fleet instance.
*
*
* @param desiredReplicaContainerGroupsPerInstance
* The desired number of replica container groups to place on each fleet instance.
*/
public void setDesiredReplicaContainerGroupsPerInstance(Integer desiredReplicaContainerGroupsPerInstance) {
this.desiredReplicaContainerGroupsPerInstance = desiredReplicaContainerGroupsPerInstance;
}
/**
*
* The desired number of replica container groups to place on each fleet instance.
*
*
* @return The desired number of replica container groups to place on each fleet instance.
*/
public Integer getDesiredReplicaContainerGroupsPerInstance() {
return this.desiredReplicaContainerGroupsPerInstance;
}
/**
*
* The desired number of replica container groups to place on each fleet instance.
*
*
* @param desiredReplicaContainerGroupsPerInstance
* The desired number of replica container groups to place on each fleet instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ContainerGroupsPerInstance withDesiredReplicaContainerGroupsPerInstance(Integer desiredReplicaContainerGroupsPerInstance) {
setDesiredReplicaContainerGroupsPerInstance(desiredReplicaContainerGroupsPerInstance);
return this;
}
/**
*
* The maximum possible number of replica container groups that each fleet instance can have.
*
*
* @param maxReplicaContainerGroupsPerInstance
* The maximum possible number of replica container groups that each fleet instance can have.
*/
public void setMaxReplicaContainerGroupsPerInstance(Integer maxReplicaContainerGroupsPerInstance) {
this.maxReplicaContainerGroupsPerInstance = maxReplicaContainerGroupsPerInstance;
}
/**
*
* The maximum possible number of replica container groups that each fleet instance can have.
*
*
* @return The maximum possible number of replica container groups that each fleet instance can have.
*/
public Integer getMaxReplicaContainerGroupsPerInstance() {
return this.maxReplicaContainerGroupsPerInstance;
}
/**
*
* The maximum possible number of replica container groups that each fleet instance can have.
*
*
* @param maxReplicaContainerGroupsPerInstance
* The maximum possible number of replica container groups that each fleet instance can have.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ContainerGroupsPerInstance withMaxReplicaContainerGroupsPerInstance(Integer maxReplicaContainerGroupsPerInstance) {
setMaxReplicaContainerGroupsPerInstance(maxReplicaContainerGroupsPerInstance);
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 (getDesiredReplicaContainerGroupsPerInstance() != null)
sb.append("DesiredReplicaContainerGroupsPerInstance: ").append(getDesiredReplicaContainerGroupsPerInstance()).append(",");
if (getMaxReplicaContainerGroupsPerInstance() != null)
sb.append("MaxReplicaContainerGroupsPerInstance: ").append(getMaxReplicaContainerGroupsPerInstance());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ContainerGroupsPerInstance == false)
return false;
ContainerGroupsPerInstance other = (ContainerGroupsPerInstance) obj;
if (other.getDesiredReplicaContainerGroupsPerInstance() == null ^ this.getDesiredReplicaContainerGroupsPerInstance() == null)
return false;
if (other.getDesiredReplicaContainerGroupsPerInstance() != null
&& other.getDesiredReplicaContainerGroupsPerInstance().equals(this.getDesiredReplicaContainerGroupsPerInstance()) == false)
return false;
if (other.getMaxReplicaContainerGroupsPerInstance() == null ^ this.getMaxReplicaContainerGroupsPerInstance() == null)
return false;
if (other.getMaxReplicaContainerGroupsPerInstance() != null
&& other.getMaxReplicaContainerGroupsPerInstance().equals(this.getMaxReplicaContainerGroupsPerInstance()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDesiredReplicaContainerGroupsPerInstance() == null) ? 0 : getDesiredReplicaContainerGroupsPerInstance().hashCode());
hashCode = prime * hashCode + ((getMaxReplicaContainerGroupsPerInstance() == null) ? 0 : getMaxReplicaContainerGroupsPerInstance().hashCode());
return hashCode;
}
@Override
public ContainerGroupsPerInstance clone() {
try {
return (ContainerGroupsPerInstance) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.gamelift.model.transform.ContainerGroupsPerInstanceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}