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.opsworks.model;
 

Describes an Elastic Load Balancing instance.

 
 public class ElasticLoadBalancer implements SerializableCloneable {

    
The Elastic Load Balancing instance's name.
 
     private String elasticLoadBalancerName;

    
The instance's AWS region.
 
     private String region;

    
The instance's public DNS name.
 
     private String dnsName;

    
The ID of the stack that the instance is associated with.
 
     private String stackId;

    
The ID of the layer that the instance is attached to.
 
     private String layerId;

    
The VPC ID.
 
     private String vpcId;

    
A list of Availability Zones.
 
A list of subnet IDs, if the stack is running in a VPC.
 
A list of the EC2 instances that the Elastic Load Balancing instance is managing traffic for.
 
The Elastic Load Balancing instance's name.

Returns:
The Elastic Load Balancing instance's name.
 
     public String getElasticLoadBalancerName() {
         return ;
     }
    
    
The Elastic Load Balancing instance's name.

Parameters:
elasticLoadBalancerName The Elastic Load Balancing instance's name.
 
     public void setElasticLoadBalancerName(String elasticLoadBalancerName) {
         this. = elasticLoadBalancerName;
     }
    
    
The Elastic Load Balancing instance's name.

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

Parameters:
elasticLoadBalancerName The Elastic Load Balancing instance's name.
Returns:
A reference to this updated object so that method calls can be chained together.
 
    public ElasticLoadBalancer withElasticLoadBalancerName(String elasticLoadBalancerName) {
        this. = elasticLoadBalancerName;
        return this;
    }

    
The instance's AWS region.

Returns:
The instance's AWS region.
    public String getRegion() {
        return ;
    }
    
    
The instance's AWS region.

Parameters:
region The instance's AWS region.
    public void setRegion(String region) {
        this. = region;
    }
    
    
The instance's AWS region.

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

Parameters:
region The instance's AWS region.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ElasticLoadBalancer withRegion(String region) {
        this. = region;
        return this;
    }

    
The instance's public DNS name.

Returns:
The instance's public DNS name.
    public String getDnsName() {
        return ;
    }
    
    
The instance's public DNS name.

Parameters:
dnsName The instance's public DNS name.
    public void setDnsName(String dnsName) {
        this. = dnsName;
    }
    
    
The instance's public DNS name.

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

Parameters:
dnsName The instance's public DNS name.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ElasticLoadBalancer withDnsName(String dnsName) {
        this. = dnsName;
        return this;
    }

    
The ID of the stack that the instance is associated with.

Returns:
The ID of the stack that the instance is associated with.
    public String getStackId() {
        return ;
    }
    
    
The ID of the stack that the instance is associated with.

Parameters:
stackId The ID of the stack that the instance is associated with.
    public void setStackId(String stackId) {
        this. = stackId;
    }
    
    
The ID of the stack that the instance is associated with.

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

Parameters:
stackId The ID of the stack that the instance is associated with.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ElasticLoadBalancer withStackId(String stackId) {
        this. = stackId;
        return this;
    }

    
The ID of the layer that the instance is attached to.

Returns:
The ID of the layer that the instance is attached to.
    public String getLayerId() {
        return ;
    }
    
    
The ID of the layer that the instance is attached to.

Parameters:
layerId The ID of the layer that the instance is attached to.
    public void setLayerId(String layerId) {
        this. = layerId;
    }
    
    
The ID of the layer that the instance is attached to.

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

Parameters:
layerId The ID of the layer that the instance is attached to.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ElasticLoadBalancer withLayerId(String layerId) {
        this. = layerId;
        return this;
    }

    
The VPC ID.

Returns:
The VPC ID.
    public String getVpcId() {
        return ;
    }
    
    
The VPC ID.

Parameters:
vpcId The VPC ID.
    public void setVpcId(String vpcId) {
        this. = vpcId;
    }
    
    
The VPC ID.

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

Parameters:
vpcId The VPC ID.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ElasticLoadBalancer withVpcId(String vpcId) {
        this. = vpcId;
        return this;
    }

    
A list of Availability Zones.

Returns:
A list of Availability Zones.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of Availability Zones.

Parameters:
availabilityZones A list of Availability Zones.
    public void setAvailabilityZones(java.util.Collection<StringavailabilityZones) {
        if (availabilityZones == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringavailabilityZonesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(availabilityZones.size());
        availabilityZonesCopy.addAll(availabilityZones);
        this. = availabilityZonesCopy;
    }
    
    
A list of Availability Zones.

NOTE: This method appends the values to the existing list (if any). Use setAvailabilityZones(java.util.Collection) or withAvailabilityZones(java.util.Collection) if you want to override the existing values.

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

Parameters:
availabilityZones A list of Availability Zones.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ElasticLoadBalancer withAvailabilityZones(String... availabilityZones) {
        if (getAvailabilityZones() == nullsetAvailabilityZones(new java.util.ArrayList<String>(availabilityZones.length));
        for (String value : availabilityZones) {
            getAvailabilityZones().add(value);
        }
        return this;
    }
    
    
A list of Availability Zones.

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

Parameters:
availabilityZones A list of Availability Zones.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ElasticLoadBalancer withAvailabilityZones(java.util.Collection<StringavailabilityZones) {
        if (availabilityZones == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringavailabilityZonesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(availabilityZones.size());
            availabilityZonesCopy.addAll(availabilityZones);
            this. = availabilityZonesCopy;
        }
        return this;
    }

    
A list of subnet IDs, if the stack is running in a VPC.

Returns:
A list of subnet IDs, if the stack is running in a VPC.
    public java.util.List<StringgetSubnetIds() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of subnet IDs, if the stack is running in a VPC.

Parameters:
subnetIds A list of subnet IDs, if the stack is running in a VPC.
    public void setSubnetIds(java.util.Collection<StringsubnetIds) {
        if (subnetIds == null) {
            this. = null;
            return;
        }
        subnetIdsCopy.addAll(subnetIds);
        this. = subnetIdsCopy;
    }
    
    
A list of subnet IDs, if the stack is running in a VPC.

NOTE: This method appends the values to the existing list (if any). Use setSubnetIds(java.util.Collection) or withSubnetIds(java.util.Collection) if you want to override the existing values.

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

Parameters:
subnetIds A list of subnet IDs, if the stack is running in a VPC.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ElasticLoadBalancer withSubnetIds(String... subnetIds) {
        if (getSubnetIds() == nullsetSubnetIds(new java.util.ArrayList<String>(subnetIds.length));
        for (String value : subnetIds) {
            getSubnetIds().add(value);
        }
        return this;
    }
    
    
A list of subnet IDs, if the stack is running in a VPC.

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

Parameters:
subnetIds A list of subnet IDs, if the stack is running in a VPC.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (subnetIds == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringsubnetIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(subnetIds.size());
            subnetIdsCopy.addAll(subnetIds);
            this. = subnetIdsCopy;
        }
        return this;
    }

    
A list of the EC2 instances that the Elastic Load Balancing instance is managing traffic for.

Returns:
A list of the EC2 instances that the Elastic Load Balancing instance is managing traffic for.
    public java.util.List<StringgetEc2InstanceIds() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of the EC2 instances that the Elastic Load Balancing instance is managing traffic for.

Parameters:
ec2InstanceIds A list of the EC2 instances that the Elastic Load Balancing instance is managing traffic for.
    public void setEc2InstanceIds(java.util.Collection<Stringec2InstanceIds) {
        if (ec2InstanceIds == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<Stringec2InstanceIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(ec2InstanceIds.size());
        ec2InstanceIdsCopy.addAll(ec2InstanceIds);
        this. = ec2InstanceIdsCopy;
    }
    
    
A list of the EC2 instances that the Elastic Load Balancing instance is managing traffic for.

NOTE: This method appends the values to the existing list (if any). Use setEc2InstanceIds(java.util.Collection) or withEc2InstanceIds(java.util.Collection) if you want to override the existing values.

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

Parameters:
ec2InstanceIds A list of the EC2 instances that the Elastic Load Balancing instance is managing traffic for.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ElasticLoadBalancer withEc2InstanceIds(String... ec2InstanceIds) {
        if (getEc2InstanceIds() == nullsetEc2InstanceIds(new java.util.ArrayList<String>(ec2InstanceIds.length));
        for (String value : ec2InstanceIds) {
            getEc2InstanceIds().add(value);
        }
        return this;
    }
    
    
A list of the EC2 instances that the Elastic Load Balancing instance is managing traffic for.

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

Parameters:
ec2InstanceIds A list of the EC2 instances that the Elastic Load Balancing instance is managing traffic for.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ElasticLoadBalancer withEc2InstanceIds(java.util.Collection<Stringec2InstanceIds) {
        if (ec2InstanceIds == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<Stringec2InstanceIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(ec2InstanceIds.size());
            ec2InstanceIdsCopy.addAll(ec2InstanceIds);
            this. = ec2InstanceIdsCopy;
        }
        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 (getElasticLoadBalancerName() != nullsb.append("ElasticLoadBalancerName: " + getElasticLoadBalancerName() + ",");
        if (getRegion() != nullsb.append("Region: " + getRegion() + ",");
        if (getDnsName() != nullsb.append("DnsName: " + getDnsName() + ",");
        if (getStackId() != nullsb.append("StackId: " + getStackId() + ",");
        if (getLayerId() != nullsb.append("LayerId: " + getLayerId() + ",");
        if (getVpcId() != nullsb.append("VpcId: " + getVpcId() + ",");
        if (getAvailabilityZones() != nullsb.append("AvailabilityZones: " + getAvailabilityZones() + ",");
        if (getSubnetIds() != nullsb.append("SubnetIds: " + getSubnetIds() + ",");
        if (getEc2InstanceIds() != nullsb.append("Ec2InstanceIds: " + getEc2InstanceIds() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getElasticLoadBalancerName() == null) ? 0 : getElasticLoadBalancerName().hashCode()); 
        hashCode = prime * hashCode + ((getRegion() == null) ? 0 : getRegion().hashCode()); 
        hashCode = prime * hashCode + ((getDnsName() == null) ? 0 : getDnsName().hashCode()); 
        hashCode = prime * hashCode + ((getStackId() == null) ? 0 : getStackId().hashCode()); 
        hashCode = prime * hashCode + ((getLayerId() == null) ? 0 : getLayerId().hashCode()); 
        hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode()); 
        hashCode = prime * hashCode + ((getAvailabilityZones() == null) ? 0 : getAvailabilityZones().hashCode()); 
        hashCode = prime * hashCode + ((getSubnetIds() == null) ? 0 : getSubnetIds().hashCode()); 
        hashCode = prime * hashCode + ((getEc2InstanceIds() == null) ? 0 : getEc2InstanceIds().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ElasticLoadBalancer == falsereturn false;
        ElasticLoadBalancer other = (ElasticLoadBalancer)obj;
        
        if (other.getElasticLoadBalancerName() == null ^ this.getElasticLoadBalancerName() == nullreturn false;
        if (other.getElasticLoadBalancerName() != null && other.getElasticLoadBalancerName().equals(this.getElasticLoadBalancerName()) == falsereturn false
        if (other.getRegion() == null ^ this.getRegion() == nullreturn false;
        if (other.getRegion() != null && other.getRegion().equals(this.getRegion()) == falsereturn false
        if (other.getDnsName() == null ^ this.getDnsName() == nullreturn false;
        if (other.getDnsName() != null && other.getDnsName().equals(this.getDnsName()) == falsereturn false
        if (other.getStackId() == null ^ this.getStackId() == nullreturn false;
        if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == falsereturn false
        if (other.getLayerId() == null ^ this.getLayerId() == nullreturn false;
        if (other.getLayerId() != null && other.getLayerId().equals(this.getLayerId()) == falsereturn false
        if (other.getVpcId() == null ^ this.getVpcId() == nullreturn false;
        if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == falsereturn false
        if (other.getAvailabilityZones() == null ^ this.getAvailabilityZones() == nullreturn false;
        if (other.getAvailabilityZones() != null && other.getAvailabilityZones().equals(this.getAvailabilityZones()) == falsereturn false
        if (other.getSubnetIds() == null ^ this.getSubnetIds() == nullreturn false;
        if (other.getSubnetIds() != null && other.getSubnetIds().equals(this.getSubnetIds()) == falsereturn false
        if (other.getEc2InstanceIds() == null ^ this.getEc2InstanceIds() == nullreturn false;
        if (other.getEc2InstanceIds() != null && other.getEc2InstanceIds().equals(this.getEc2InstanceIds()) == falsereturn false
        return true;
    }
    
    @Override
    public ElasticLoadBalancer clone() {
        try {
            return (ElasticLoadBalancersuper.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