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 AWS OpsWorks service error.

 
 public class ServiceError implements SerializableCloneable {

    
The error ID.
 
     private String serviceErrorId;

    
The stack ID.
 
     private String stackId;

    
The instance ID.
 
     private String instanceId;

    
The error type.
 
     private String type;

    
A message that describes the error.
 
     private String message;

    
When the error occurred.
 
     private String createdAt;

    
The error ID.

Returns:
The error ID.
 
     public String getServiceErrorId() {
         return ;
     }
    
    
The error ID.

Parameters:
serviceErrorId The error ID.
 
     public void setServiceErrorId(String serviceErrorId) {
         this. = serviceErrorId;
     }
    
    
The error ID.

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

Parameters:
serviceErrorId The error ID.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ServiceError withServiceErrorId(String serviceErrorId) {
         this. = serviceErrorId;
         return this;
     }

    
The stack ID.

Returns:
The stack ID.
 
     public String getStackId() {
         return ;
     }
    
    
The stack ID.

Parameters:
stackId The stack ID.
    public void setStackId(String stackId) {
        this. = stackId;
    }
    
    
The stack ID.

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

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

    
The instance ID.

Returns:
The instance ID.
    public String getInstanceId() {
        return ;
    }
    
    
The instance ID.

Parameters:
instanceId The instance ID.
    public void setInstanceId(String instanceId) {
        this. = instanceId;
    }
    
    
The instance ID.

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

Parameters:
instanceId The instance ID.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ServiceError withInstanceId(String instanceId) {
        this. = instanceId;
        return this;
    }

    
The error type.

Returns:
The error type.
    public String getType() {
        return ;
    }
    
    
The error type.

Parameters:
type The error type.
    public void setType(String type) {
        this. = type;
    }
    
    
The error type.

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

Parameters:
type The error type.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ServiceError withType(String type) {
        this. = type;
        return this;
    }

    
A message that describes the error.

Returns:
A message that describes the error.
    public String getMessage() {
        return ;
    }
    
    
A message that describes the error.

Parameters:
message A message that describes the error.
    public void setMessage(String message) {
        this. = message;
    }
    
    
A message that describes the error.

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

Parameters:
message A message that describes the error.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ServiceError withMessage(String message) {
        this. = message;
        return this;
    }

    
When the error occurred.

Returns:
When the error occurred.
    public String getCreatedAt() {
        return ;
    }
    
    
When the error occurred.

Parameters:
createdAt When the error occurred.
    public void setCreatedAt(String createdAt) {
        this. = createdAt;
    }
    
    
When the error occurred.

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

Parameters:
createdAt When the error occurred.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ServiceError withCreatedAt(String createdAt) {
        this. = createdAt;
        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 (getServiceErrorId() != nullsb.append("ServiceErrorId: " + getServiceErrorId() + ",");
        if (getStackId() != nullsb.append("StackId: " + getStackId() + ",");
        if (getInstanceId() != nullsb.append("InstanceId: " + getInstanceId() + ",");
        if (getType() != nullsb.append("Type: " + getType() + ",");
        if (getMessage() != nullsb.append("Message: " + getMessage() + ",");
        if (getCreatedAt() != nullsb.append("CreatedAt: " + getCreatedAt() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getServiceErrorId() == null) ? 0 : getServiceErrorId().hashCode()); 
        hashCode = prime * hashCode + ((getStackId() == null) ? 0 : getStackId().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); 
        hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); 
        hashCode = prime * hashCode + ((getMessage() == null) ? 0 : getMessage().hashCode()); 
        hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ServiceError == falsereturn false;
        ServiceError other = (ServiceError)obj;
        
        if (other.getServiceErrorId() == null ^ this.getServiceErrorId() == nullreturn false;
        if (other.getServiceErrorId() != null && other.getServiceErrorId().equals(this.getServiceErrorId()) == falsereturn false
        if (other.getStackId() == null ^ this.getStackId() == nullreturn false;
        if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == falsereturn false
        if (other.getInstanceId() == null ^ this.getInstanceId() == nullreturn false;
        if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == falsereturn false
        if (other.getType() == null ^ this.getType() == nullreturn false;
        if (other.getType() != null && other.getType().equals(this.getType()) == falsereturn false
        if (other.getMessage() == null ^ this.getMessage() == nullreturn false;
        if (other.getMessage() != null && other.getMessage().equals(this.getMessage()) == falsereturn false
        if (other.getCreatedAt() == null ^ this.getCreatedAt() == nullreturn false;
        if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == falsereturn false
        return true;
    }
    
    @Override
    public ServiceError clone() {
        try {
            return (ServiceErrorsuper.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