shiver.me.timbers.aws.ecs.TaskDefinitionPortMapping Maven / Gradle / Ivy
Show all versions of smt-cloudformation-objects Show documentation
package shiver.me.timbers.aws.ecs;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import shiver.me.timbers.aws.Property;
/**
* TaskDefinitionPortMapping
*
* http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-portmappings.html
*
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonPropertyOrder({
"ContainerPort",
"HostPort",
"Protocol"
})
public class TaskDefinitionPortMapping implements Property
{
/**
* http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-portmappings.html#cfn-ecs-taskdefinition-containerdefinition-portmappings-containerport
*
*/
@JsonProperty("ContainerPort")
@JsonPropertyDescription("http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-portmappings.html#cfn-ecs-taskdefinition-containerdefinition-portmappings-containerport")
private Number containerPort;
/**
* http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-portmappings.html#cfn-ecs-taskdefinition-containerdefinition-portmappings-readonly
*
*/
@JsonProperty("HostPort")
@JsonPropertyDescription("http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-portmappings.html#cfn-ecs-taskdefinition-containerdefinition-portmappings-readonly")
private Number hostPort;
/**
* http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-portmappings.html#cfn-ecs-taskdefinition-containerdefinition-portmappings-sourcevolume
*
*/
@JsonProperty("Protocol")
@JsonPropertyDescription("http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-portmappings.html#cfn-ecs-taskdefinition-containerdefinition-portmappings-sourcevolume")
private CharSequence protocol;
/**
* http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-portmappings.html#cfn-ecs-taskdefinition-containerdefinition-portmappings-containerport
*
*/
@JsonIgnore
public Number getContainerPort() {
return containerPort;
}
/**
* http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-portmappings.html#cfn-ecs-taskdefinition-containerdefinition-portmappings-containerport
*
*/
@JsonIgnore
public void setContainerPort(Number containerPort) {
this.containerPort = containerPort;
}
public TaskDefinitionPortMapping withContainerPort(Number containerPort) {
this.containerPort = containerPort;
return this;
}
/**
* http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-portmappings.html#cfn-ecs-taskdefinition-containerdefinition-portmappings-readonly
*
*/
@JsonIgnore
public Number getHostPort() {
return hostPort;
}
/**
* http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-portmappings.html#cfn-ecs-taskdefinition-containerdefinition-portmappings-readonly
*
*/
@JsonIgnore
public void setHostPort(Number hostPort) {
this.hostPort = hostPort;
}
public TaskDefinitionPortMapping withHostPort(Number hostPort) {
this.hostPort = hostPort;
return this;
}
/**
* http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-portmappings.html#cfn-ecs-taskdefinition-containerdefinition-portmappings-sourcevolume
*
*/
@JsonIgnore
public CharSequence getProtocol() {
return protocol;
}
/**
* http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-portmappings.html#cfn-ecs-taskdefinition-containerdefinition-portmappings-sourcevolume
*
*/
@JsonIgnore
public void setProtocol(CharSequence protocol) {
this.protocol = protocol;
}
public TaskDefinitionPortMapping withProtocol(CharSequence protocol) {
this.protocol = protocol;
return this;
}
@Override
public String toString() {
return new ToStringBuilder(this).append("containerPort", containerPort).append("hostPort", hostPort).append("protocol", protocol).toString();
}
@Override
public int hashCode() {
return new HashCodeBuilder().append(containerPort).append(hostPort).append(protocol).toHashCode();
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof TaskDefinitionPortMapping) == false) {
return false;
}
TaskDefinitionPortMapping rhs = ((TaskDefinitionPortMapping) other);
return new EqualsBuilder().append(containerPort, rhs.containerPort).append(hostPort, rhs.hostPort).append(protocol, rhs.protocol).isEquals();
}
}