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 DescribeServicesResult implements SerializableCloneable {

    
The list of services described.
 
Any failures associated with the call.
 
The list of services described.

Returns:
The list of services described.
 
     public java.util.List<ServicegetServices() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<Service>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
The list of services described.

Parameters:
services The list of services described.
 
     public void setServices(java.util.Collection<Serviceservices) {
         if (services == null) {
             this. = null;
             return;
         }
         servicesCopy.addAll(services);
         this. = servicesCopy;
     }
    
    
The list of services described.

NOTE: This method appends the values to the existing list (if any). Use setServices(java.util.Collection) or withServices(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:
services The list of services described.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public DescribeServicesResult withServices(Service... services) {
         if (getServices() == nullsetServices(new java.util.ArrayList<Service>(services.length));
         for (Service value : services) {
             getServices().add(value);
         }
         return this;
     }
    
    
The list of services described.

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

Parameters:
services The list of services described.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         if (services == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<ServiceservicesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<Service>(services.size());
            servicesCopy.addAll(services);
            this. = servicesCopy;
        }
        return this;
    }

    
Any failures associated with the call.

Returns:
Any failures associated with the call.
    public java.util.List<FailuregetFailures() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Failure>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Any failures associated with the call.

Parameters:
failures Any failures associated with the call.
    public void setFailures(java.util.Collection<Failurefailures) {
        if (failures == null) {
            this. = null;
            return;
        }
        failuresCopy.addAll(failures);
        this. = failuresCopy;
    }
    
    
Any failures associated with the call.

NOTE: This method appends the values to the existing list (if any). Use setFailures(java.util.Collection) or withFailures(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:
failures Any failures associated with the call.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DescribeServicesResult withFailures(Failure... failures) {
        if (getFailures() == nullsetFailures(new java.util.ArrayList<Failure>(failures.length));
        for (Failure value : failures) {
            getFailures().add(value);
        }
        return this;
    }
    
    
Any failures associated with the call.

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

Parameters:
failures Any failures associated with the call.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (failures == null) {
            this. = null;
        } else {
            failuresCopy.addAll(failures);
            this. = failuresCopy;
        }
        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 (getServices() != nullsb.append("Services: " + getServices() + ",");
        if (getFailures() != nullsb.append("Failures: " + getFailures() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getServices() == null) ? 0 : getServices().hashCode()); 
        hashCode = prime * hashCode + ((getFailures() == null) ? 0 : getFailures().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof DescribeServicesResult == falsereturn false;
        DescribeServicesResult other = (DescribeServicesResult)obj;
        
        if (other.getServices() == null ^ this.getServices() == nullreturn false;
        if (other.getServices() != null && other.getServices().equals(this.getServices()) == falsereturn false
        if (other.getFailures() == null ^ this.getFailures() == nullreturn false;
        if (other.getFailures() != null && other.getFailures().equals(this.getFailures()) == falsereturn false
        return true;
    }
    
    @Override
    public DescribeServicesResult clone() {
        try {
            return (DescribeServicesResultsuper.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