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

Describes the AWS resources in use by this environment. This data is live.

 
 public class EnvironmentResourceDescription implements SerializableCloneable {

    
The name of the environment.

Constraints:
Length: 4 - 23

 
     private String environmentName;

    
The AutoScalingGroups used by this environment.
 
The Amazon EC2 instances used by this environment.
 
The Auto Scaling launch configurations in use by this environment.
 
The LoadBalancers in use by this environment.
 
The AutoScaling triggers in use by this environment.
 
The queues used by this environment.
 
Default constructor for a new EnvironmentResourceDescription object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public EnvironmentResourceDescription() {}
    
    
The name of the environment.

Constraints:
Length: 4 - 23

Returns:
The name of the environment.
 
     public String getEnvironmentName() {
         return ;
     }
    
    
The name of the environment.

Constraints:
Length: 4 - 23

Parameters:
environmentName The name of the environment.
 
     public void setEnvironmentName(String environmentName) {
         this. = environmentName;
     }
    
    
The name of the environment.

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

Constraints:
Length: 4 - 23

Parameters:
environmentName The name of the environment.
Returns:
A reference to this updated object so that method calls can be chained together.
    public EnvironmentResourceDescription withEnvironmentName(String environmentName) {
        this. = environmentName;
        return this;
    }

    
The AutoScalingGroups used by this environment.

Returns:
The AutoScalingGroups used by this environment.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The AutoScalingGroups used by this environment.

Parameters:
autoScalingGroups The AutoScalingGroups used by this environment.
    public void setAutoScalingGroups(java.util.Collection<AutoScalingGroupautoScalingGroups) {
        if (autoScalingGroups == null) {
            this. = null;
            return;
        }
        autoScalingGroupsCopy.addAll(autoScalingGroups);
        this. = autoScalingGroupsCopy;
    }
    
    
The AutoScalingGroups used by this environment.

NOTE: This method appends the values to the existing list (if any). Use setAutoScalingGroups(java.util.Collection) or withAutoScalingGroups(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:
autoScalingGroups The AutoScalingGroups used by this environment.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (getAutoScalingGroups() == nullsetAutoScalingGroups(new java.util.ArrayList<AutoScalingGroup>(autoScalingGroups.length));
        for (AutoScalingGroup value : autoScalingGroups) {
            getAutoScalingGroups().add(value);
        }
        return this;
    }
    
    
The AutoScalingGroups used by this environment.

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

Parameters:
autoScalingGroups The AutoScalingGroups used by this environment.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (autoScalingGroups == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<AutoScalingGroupautoScalingGroupsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<AutoScalingGroup>(autoScalingGroups.size());
            autoScalingGroupsCopy.addAll(autoScalingGroups);
            this. = autoScalingGroupsCopy;
        }
        return this;
    }

    
The Amazon EC2 instances used by this environment.

Returns:
The Amazon EC2 instances used by this environment.
    public java.util.List<InstancegetInstances() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Instance>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The Amazon EC2 instances used by this environment.

Parameters:
instances The Amazon EC2 instances used by this environment.
    public void setInstances(java.util.Collection<Instanceinstances) {
        if (instances == null) {
            this. = null;
            return;
        }
        instancesCopy.addAll(instances);
        this. = instancesCopy;
    }
    
    
The Amazon EC2 instances used by this environment.

NOTE: This method appends the values to the existing list (if any). Use setInstances(java.util.Collection) or withInstances(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:
instances The Amazon EC2 instances used by this environment.
Returns:
A reference to this updated object so that method calls can be chained together.
    public EnvironmentResourceDescription withInstances(Instance... instances) {
        if (getInstances() == nullsetInstances(new java.util.ArrayList<Instance>(instances.length));
        for (Instance value : instances) {
            getInstances().add(value);
        }
        return this;
    }
    
    
The Amazon EC2 instances used by this environment.

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

Parameters:
instances The Amazon EC2 instances used by this environment.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (instances == null) {
            this. = null;
        } else {
            instancesCopy.addAll(instances);
            this. = instancesCopy;
        }
        return this;
    }

    
The Auto Scaling launch configurations in use by this environment.

Returns:
The Auto Scaling launch configurations in use by this environment.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The Auto Scaling launch configurations in use by this environment.

Parameters:
launchConfigurations The Auto Scaling launch configurations in use by this environment.
    public void setLaunchConfigurations(java.util.Collection<LaunchConfigurationlaunchConfigurations) {
        if (launchConfigurations == null) {
            this. = null;
            return;
        }
        launchConfigurationsCopy.addAll(launchConfigurations);
        this. = launchConfigurationsCopy;
    }
    
    
The Auto Scaling launch configurations in use by this environment.

NOTE: This method appends the values to the existing list (if any). Use setLaunchConfigurations(java.util.Collection) or withLaunchConfigurations(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:
launchConfigurations The Auto Scaling launch configurations in use by this environment.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (getLaunchConfigurations() == nullsetLaunchConfigurations(new java.util.ArrayList<LaunchConfiguration>(launchConfigurations.length));
        for (LaunchConfiguration value : launchConfigurations) {
            getLaunchConfigurations().add(value);
        }
        return this;
    }
    
    
The Auto Scaling launch configurations in use by this environment.

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

Parameters:
launchConfigurations The Auto Scaling launch configurations in use by this environment.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (launchConfigurations == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<LaunchConfigurationlaunchConfigurationsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<LaunchConfiguration>(launchConfigurations.size());
            launchConfigurationsCopy.addAll(launchConfigurations);
            this. = launchConfigurationsCopy;
        }
        return this;
    }

    
The LoadBalancers in use by this environment.

Returns:
The LoadBalancers in use by this environment.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The LoadBalancers in use by this environment.

Parameters:
loadBalancers The LoadBalancers in use by this environment.
    public void setLoadBalancers(java.util.Collection<LoadBalancerloadBalancers) {
        if (loadBalancers == null) {
            this. = null;
            return;
        }
        loadBalancersCopy.addAll(loadBalancers);
        this. = loadBalancersCopy;
    }
    
    
The LoadBalancers in use by this environment.

NOTE: This method appends the values to the existing list (if any). Use setLoadBalancers(java.util.Collection) or withLoadBalancers(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:
loadBalancers The LoadBalancers in use by this environment.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (getLoadBalancers() == nullsetLoadBalancers(new java.util.ArrayList<LoadBalancer>(loadBalancers.length));
        for (LoadBalancer value : loadBalancers) {
            getLoadBalancers().add(value);
        }
        return this;
    }
    
    
The LoadBalancers in use by this environment.

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

Parameters:
loadBalancers The LoadBalancers in use by this environment.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (loadBalancers == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<LoadBalancerloadBalancersCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<LoadBalancer>(loadBalancers.size());
            loadBalancersCopy.addAll(loadBalancers);
            this. = loadBalancersCopy;
        }
        return this;
    }

    
The AutoScaling triggers in use by this environment.

Returns:
The AutoScaling triggers in use by this environment.
    public java.util.List<TriggergetTriggers() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Trigger>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The AutoScaling triggers in use by this environment.

Parameters:
triggers The AutoScaling triggers in use by this environment.
    public void setTriggers(java.util.Collection<Triggertriggers) {
        if (triggers == null) {
            this. = null;
            return;
        }
        triggersCopy.addAll(triggers);
        this. = triggersCopy;
    }
    
    
The AutoScaling triggers in use by this environment.

NOTE: This method appends the values to the existing list (if any). Use setTriggers(java.util.Collection) or withTriggers(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:
triggers The AutoScaling triggers in use by this environment.
Returns:
A reference to this updated object so that method calls can be chained together.
    public EnvironmentResourceDescription withTriggers(Trigger... triggers) {
        if (getTriggers() == nullsetTriggers(new java.util.ArrayList<Trigger>(triggers.length));
        for (Trigger value : triggers) {
            getTriggers().add(value);
        }
        return this;
    }
    
    
The AutoScaling triggers in use by this environment.

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

Parameters:
triggers The AutoScaling triggers in use by this environment.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (triggers == null) {
            this. = null;
        } else {
            triggersCopy.addAll(triggers);
            this. = triggersCopy;
        }
        return this;
    }

    
The queues used by this environment.

Returns:
The queues used by this environment.
    public java.util.List<QueuegetQueues() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Queue>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The queues used by this environment.

Parameters:
queues The queues used by this environment.
    public void setQueues(java.util.Collection<Queuequeues) {
        if (queues == null) {
            this. = null;
            return;
        }
        queuesCopy.addAll(queues);
        this. = queuesCopy;
    }
    
    
The queues used by this environment.

NOTE: This method appends the values to the existing list (if any). Use setQueues(java.util.Collection) or withQueues(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:
queues The queues used by this environment.
Returns:
A reference to this updated object so that method calls can be chained together.
    public EnvironmentResourceDescription withQueues(Queue... queues) {
        if (getQueues() == nullsetQueues(new java.util.ArrayList<Queue>(queues.length));
        for (Queue value : queues) {
            getQueues().add(value);
        }
        return this;
    }
    
    
The queues used by this environment.

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

Parameters:
queues The queues used by this environment.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (queues == null) {
            this. = null;
        } else {
            queuesCopy.addAll(queues);
            this. = queuesCopy;
        }
        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 (getEnvironmentName() != nullsb.append("EnvironmentName: " + getEnvironmentName() + ",");
        if (getAutoScalingGroups() != nullsb.append("AutoScalingGroups: " + getAutoScalingGroups() + ",");
        if (getInstances() != nullsb.append("Instances: " + getInstances() + ",");
        if (getLaunchConfigurations() != nullsb.append("LaunchConfigurations: " + getLaunchConfigurations() + ",");
        if (getLoadBalancers() != nullsb.append("LoadBalancers: " + getLoadBalancers() + ",");
        if (getTriggers() != nullsb.append("Triggers: " + getTriggers() + ",");
        if (getQueues() != nullsb.append("Queues: " + getQueues() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getEnvironmentName() == null) ? 0 : getEnvironmentName().hashCode()); 
        hashCode = prime * hashCode + ((getAutoScalingGroups() == null) ? 0 : getAutoScalingGroups().hashCode()); 
        hashCode = prime * hashCode + ((getInstances() == null) ? 0 : getInstances().hashCode()); 
        hashCode = prime * hashCode + ((getLaunchConfigurations() == null) ? 0 : getLaunchConfigurations().hashCode()); 
        hashCode = prime * hashCode + ((getLoadBalancers() == null) ? 0 : getLoadBalancers().hashCode()); 
        hashCode = prime * hashCode + ((getTriggers() == null) ? 0 : getTriggers().hashCode()); 
        hashCode = prime * hashCode + ((getQueues() == null) ? 0 : getQueues().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof EnvironmentResourceDescription == falsereturn false;
        
        if (other.getEnvironmentName() == null ^ this.getEnvironmentName() == nullreturn false;
        if (other.getEnvironmentName() != null && other.getEnvironmentName().equals(this.getEnvironmentName()) == falsereturn false
        if (other.getAutoScalingGroups() == null ^ this.getAutoScalingGroups() == nullreturn false;
        if (other.getAutoScalingGroups() != null && other.getAutoScalingGroups().equals(this.getAutoScalingGroups()) == falsereturn false
        if (other.getInstances() == null ^ this.getInstances() == nullreturn false;
        if (other.getInstances() != null && other.getInstances().equals(this.getInstances()) == falsereturn false
        if (other.getLaunchConfigurations() == null ^ this.getLaunchConfigurations() == nullreturn false;
        if (other.getLaunchConfigurations() != null && other.getLaunchConfigurations().equals(this.getLaunchConfigurations()) == falsereturn false
        if (other.getLoadBalancers() == null ^ this.getLoadBalancers() == nullreturn false;
        if (other.getLoadBalancers() != null && other.getLoadBalancers().equals(this.getLoadBalancers()) == falsereturn false
        if (other.getTriggers() == null ^ this.getTriggers() == nullreturn false;
        if (other.getTriggers() != null && other.getTriggers().equals(this.getTriggers()) == falsereturn false
        if (other.getQueues() == null ^ this.getQueues() == nullreturn false;
        if (other.getQueues() != null && other.getQueues().equals(this.getQueues()) == falsereturn false
        return true;
    }
    
    @Override
        try {
            return (EnvironmentResourceDescriptionsuper.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