Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2014 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.sqs.model;
 

This is used in the responses of batch API to give a detailed description of the result of an action on each entry in the request.

 
 public class BatchResultErrorEntry implements Serializable {

    
The id of an entry in a batch request.
 
     private String id;

    
Whether the error happened due to the sender's fault.
 
     private Boolean senderFault;

    
An error code representing why the action failed on this entry.
 
     private String code;

    
A message explaining why the action failed on this entry.
 
     private String message;

    
The id of an entry in a batch request.

Returns:
The id of an entry in a batch request.
 
     public String getId() {
         return ;
     }
    
    
The id of an entry in a batch request.

Parameters:
id The id of an entry in a batch request.
 
     public void setId(String id) {
         this. = id;
     }
    
    
The id of an entry in a batch request.

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

Parameters:
id The id of an entry in a batch request.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public BatchResultErrorEntry withId(String id) {
         this. = id;
         return this;
     }

    
Whether the error happened due to the sender's fault.

Returns:
Whether the error happened due to the sender's fault.
 
     public Boolean isSenderFault() {
         return ;
     }
    
    
Whether the error happened due to the sender's fault.

Parameters:
senderFault Whether the error happened due to the sender's fault.
 
     public void setSenderFault(Boolean senderFault) {
         this. = senderFault;
     }
    
    
Whether the error happened due to the sender's fault.

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

Parameters:
senderFault Whether the error happened due to the sender's fault.
Returns:
A reference to this updated object so that method calls can be chained together.
    public BatchResultErrorEntry withSenderFault(Boolean senderFault) {
        this. = senderFault;
        return this;
    }

    
Whether the error happened due to the sender's fault.

Returns:
Whether the error happened due to the sender's fault.
    public Boolean getSenderFault() {
        return ;
    }

    
An error code representing why the action failed on this entry.

Returns:
An error code representing why the action failed on this entry.
    public String getCode() {
        return ;
    }
    
    
An error code representing why the action failed on this entry.

Parameters:
code An error code representing why the action failed on this entry.
    public void setCode(String code) {
        this. = code;
    }
    
    
An error code representing why the action failed on this entry.

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

Parameters:
code An error code representing why the action failed on this entry.
Returns:
A reference to this updated object so that method calls can be chained together.
    public BatchResultErrorEntry withCode(String code) {
        this. = code;
        return this;
    }

    
A message explaining why the action failed on this entry.

Returns:
A message explaining why the action failed on this entry.
    public String getMessage() {
        return ;
    }
    
    
A message explaining why the action failed on this entry.

Parameters:
message A message explaining why the action failed on this entry.
    public void setMessage(String message) {
        this. = message;
    }
    
    
A message explaining why the action failed on this entry.

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

Parameters:
message A message explaining why the action failed on this entry.
Returns:
A reference to this updated object so that method calls can be chained together.
    public BatchResultErrorEntry withMessage(String message) {
        this. = message;
        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 (getId() != nullsb.append("Id: " + getId() + ",");
        if (isSenderFault() != nullsb.append("SenderFault: " + isSenderFault() + ",");
        if (getCode() != nullsb.append("Code: " + getCode() + ",");
        if (getMessage() != nullsb.append("Message: " + getMessage() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); 
        hashCode = prime * hashCode + ((isSenderFault() == null) ? 0 : isSenderFault().hashCode()); 
        hashCode = prime * hashCode + ((getCode() == null) ? 0 : getCode().hashCode()); 
        hashCode = prime * hashCode + ((getMessage() == null) ? 0 : getMessage().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof BatchResultErrorEntry == falsereturn false;
        BatchResultErrorEntry other = (BatchResultErrorEntry)obj;
        
        if (other.getId() == null ^ this.getId() == nullreturn false;
        if (other.getId() != null && other.getId().equals(this.getId()) == falsereturn false
        if (other.isSenderFault() == null ^ this.isSenderFault() == nullreturn false;
        if (other.isSenderFault() != null && other.isSenderFault().equals(this.isSenderFault()) == falsereturn false
        if (other.getCode() == null ^ this.getCode() == nullreturn false;
        if (other.getCode() != null && other.getCode().equals(this.getCode()) == falsereturn false
        if (other.getMessage() == null ^ this.getMessage() == nullreturn false;
        if (other.getMessage() != null && other.getMessage().equals(this.getMessage()) == falsereturn false
        return true;
    }
    
}
    
New to GrepCode? Check out our FAQ X