Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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.ecs.model;
 
 
 public class NetworkBinding implements SerializableCloneable {

    
The IP address that the container is bound to on the container instance.
 
     private String bindIP;

    
The port number on the container that is be used with the network binding.
 
     private Integer containerPort;

    
The port number on the host that is used with the network binding.
 
     private Integer hostPort;

    
The IP address that the container is bound to on the container instance.

Returns:
The IP address that the container is bound to on the container instance.
 
     public String getBindIP() {
         return ;
     }
    
    
The IP address that the container is bound to on the container instance.

Parameters:
bindIP The IP address that the container is bound to on the container instance.
 
     public void setBindIP(String bindIP) {
         this. = bindIP;
     }
    
    
The IP address that the container is bound to on the container instance.

Returns a reference to this object so that method calls can be chained together.

Parameters:
bindIP The IP address that the container is bound to on the container instance.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public NetworkBinding withBindIP(String bindIP) {
         this. = bindIP;
         return this;
     }

    
The port number on the container that is be used with the network binding.

Returns:
The port number on the container that is be used with the network binding.
 
     public Integer getContainerPort() {
         return ;
     }
    
    
The port number on the container that is be used with the network binding.

Parameters:
containerPort The port number on the container that is be used with the network binding.
 
     public void setContainerPort(Integer containerPort) {
         this. = containerPort;
    }
    
    
The port number on the container that is be used with the network binding.

Returns a reference to this object so that method calls can be chained together.

Parameters:
containerPort The port number on the container that is be used with the network binding.
Returns:
A reference to this updated object so that method calls can be chained together.
    public NetworkBinding withContainerPort(Integer containerPort) {
        this. = containerPort;
        return this;
    }

    
The port number on the host that is used with the network binding.

Returns:
The port number on the host that is used with the network binding.
    public Integer getHostPort() {
        return ;
    }
    
    
The port number on the host that is used with the network binding.

Parameters:
hostPort The port number on the host that is used with the network binding.
    public void setHostPort(Integer hostPort) {
        this. = hostPort;
    }
    
    
The port number on the host that is used with the network binding.

Returns a reference to this object so that method calls can be chained together.

Parameters:
hostPort The port number on the host that is used with the network binding.
Returns:
A reference to this updated object so that method calls can be chained together.
    public NetworkBinding withHostPort(Integer hostPort) {
        this. = hostPort;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getBindIP() != nullsb.append("BindIP: " + getBindIP() + ",");
        if (getContainerPort() != nullsb.append("ContainerPort: " + getContainerPort() + ",");
        if (getHostPort() != nullsb.append("HostPort: " + getHostPort() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getBindIP() == null) ? 0 : getBindIP().hashCode()); 
        hashCode = prime * hashCode + ((getContainerPort() == null) ? 0 : getContainerPort().hashCode()); 
        hashCode = prime * hashCode + ((getHostPort() == null) ? 0 : getHostPort().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof NetworkBinding == falsereturn false;
        NetworkBinding other = (NetworkBinding)obj;
        
        if (other.getBindIP() == null ^ this.getBindIP() == nullreturn false;
        if (other.getBindIP() != null && other.getBindIP().equals(this.getBindIP()) == falsereturn false
        if (other.getContainerPort() == null ^ this.getContainerPort() == nullreturn false;
        if (other.getContainerPort() != null && other.getContainerPort().equals(this.getContainerPort()) == falsereturn false
        if (other.getHostPort() == null ^ this.getHostPort() == nullreturn false;
        if (other.getHostPort() != null && other.getHostPort().equals(this.getHostPort()) == falsereturn false
        return true;
    }
    
    @Override
    public NetworkBinding clone() {
        try {
            return (NetworkBindingsuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X