View Javadoc

1   /*
2    * Copyright 2012 DTO Labs, Inc. (http://dtolabs.com)
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   */
17  
18  /*
19  * RundeckJobDelete.java
20  * 
21  * User: Greg Schueler <a href="mailto:greg@dtosolutions.com">greg@dtosolutions.com</a>
22  * Created: 10/1/12 3:53 PM
23  * 
24  */
25  package org.rundeck.api.domain;
26  
27  
28  /**
29   * RundeckJobDelete represents a result of a job delete request.
30   *
31   * @author Greg Schueler <a href="mailto:greg@dtosolutions.com">greg@dtosolutions.com</a>
32   */
33  public class RundeckJobDelete {
34      private String id;
35      private String error;
36      private boolean successful;
37      private String errorCode;
38      private String message;
39  
40      /**
41       * Job ID
42       */
43      public String getId() {
44          return id;
45      }
46  
47      public void setId(String id) {
48          this.id = id;
49      }
50  
51      /**
52       * Error message if the job could not be deleted
53       */
54      public String getError() {
55          return error;
56      }
57  
58      public void setError(String error) {
59          this.error = error;
60      }
61  
62      /**
63       * True if the job was successfully deleted
64       */
65      public boolean isSuccessful() {
66          return successful;
67      }
68  
69      public void setSuccessful(boolean successful) {
70          this.successful = successful;
71      }
72  
73      /**
74       * Error code string if there was a failure
75       */
76      public String getErrorCode() {
77          return errorCode;
78      }
79  
80      public void setErrorCode(String errorCode) {
81          this.errorCode = errorCode;
82      }
83  
84      /**
85       * Success message if it was successful
86       */
87      public String getMessage() {
88          return message;
89      }
90  
91      public void setMessage(String message) {
92          this.message = message;
93      }
94  
95      @Override
96      public boolean equals(Object o) {
97          if (this == o) { return true; }
98          if (o == null || getClass() != o.getClass()) { return false; }
99  
100         RundeckJobDelete delete = (RundeckJobDelete) o;
101 
102         if (successful != delete.successful) { return false; }
103         if (error != null ? !error.equals(delete.error) : delete.error != null) { return false; }
104         if (errorCode != null ? !errorCode.equals(delete.errorCode) : delete.errorCode != null) { return false; }
105         if (id != null ? !id.equals(delete.id) : delete.id != null) { return false; }
106         if (message != null ? !message.equals(delete.message) : delete.message != null) { return false; }
107 
108         return true;
109     }
110 
111     @Override
112     public int hashCode() {
113         int result = id != null ? id.hashCode() : 0;
114         result = 31 * result + (error != null ? error.hashCode() : 0);
115         result = 31 * result + (successful ? 1 : 0);
116         result = 31 * result + (errorCode != null ? errorCode.hashCode() : 0);
117         result = 31 * result + (message != null ? message.hashCode() : 0);
118         return result;
119     }
120 
121     @Override
122     public String toString() {
123         return "RundeckJobDelete{" +
124                "id='" + id + '\'' +
125                ", error='" + error + '\'' +
126                ", successful=" + successful +
127                ", errorCode='" + errorCode + '\'' +
128                ", message='" + message + '\'' +
129                '}';
130     }
131 }