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

    
A full description of the tasks that were run. Each task that was successfully placed on your cluster will be described here.
 
Any failed tasks from your RunTask action are listed here.
 
A full description of the tasks that were run. Each task that was successfully placed on your cluster will be described here.

Returns:
A full description of the tasks that were run. Each task that was successfully placed on your cluster will be described here.
 
     public java.util.List<TaskgetTasks() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<Task>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
A full description of the tasks that were run. Each task that was successfully placed on your cluster will be described here.

Parameters:
tasks A full description of the tasks that were run. Each task that was successfully placed on your cluster will be described here.
 
     public void setTasks(java.util.Collection<Tasktasks) {
         if (tasks == null) {
             this. = null;
             return;
         }
         tasksCopy.addAll(tasks);
         this. = tasksCopy;
     }
    
    
A full description of the tasks that were run. Each task that was successfully placed on your cluster will be described here.

NOTE: This method appends the values to the existing list (if any). Use setTasks(java.util.Collection) or withTasks(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:
tasks A full description of the tasks that were run. Each task that was successfully placed on your cluster will be described here.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public RunTaskResult withTasks(Task... tasks) {
         if (getTasks() == nullsetTasks(new java.util.ArrayList<Task>(tasks.length));
         for (Task value : tasks) {
             getTasks().add(value);
         }
         return this;
     }
    
    
A full description of the tasks that were run. Each task that was successfully placed on your cluster will be described here.

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

Parameters:
tasks A full description of the tasks that were run. Each task that was successfully placed on your cluster will be described here.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RunTaskResult withTasks(java.util.Collection<Tasktasks) {
        if (tasks == null) {
            this. = null;
        } else {
            tasksCopy.addAll(tasks);
            this. = tasksCopy;
        }
        return this;
    }

    
Any failed tasks from your RunTask action are listed here.

Returns:
Any failed tasks from your RunTask action are listed here.
    public java.util.List<FailuregetFailures() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Failure>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Any failed tasks from your RunTask action are listed here.

Parameters:
failures Any failed tasks from your RunTask action are listed here.
    public void setFailures(java.util.Collection<Failurefailures) {
        if (failures == null) {
            this. = null;
            return;
        }
        failuresCopy.addAll(failures);
        this. = failuresCopy;
    }
    
    
Any failed tasks from your RunTask action are listed here.

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 failed tasks from your RunTask action are listed here.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RunTaskResult withFailures(Failure... failures) {
        if (getFailures() == nullsetFailures(new java.util.ArrayList<Failure>(failures.length));
        for (Failure value : failures) {
            getFailures().add(value);
        }
        return this;
    }
    
    
Any failed tasks from your RunTask action are listed here.

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

Parameters:
failures Any failed tasks from your RunTask action are listed here.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RunTaskResult withFailures(java.util.Collection<Failurefailures) {
        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 (getTasks() != nullsb.append("Tasks: " + getTasks() + ",");
        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 + ((getTasks() == null) ? 0 : getTasks().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 RunTaskResult == falsereturn false;
        RunTaskResult other = (RunTaskResult)obj;
        
        if (other.getTasks() == null ^ this.getTasks() == nullreturn false;
        if (other.getTasks() != null && other.getTasks().equals(this.getTasks()) == 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 RunTaskResult clone() {
        try {
            return (RunTaskResultsuper.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