View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.syncope.common.lib.to;
20  
21  import org.apache.commons.lang3.builder.EqualsBuilder;
22  import org.apache.commons.lang3.builder.HashCodeBuilder;
23  import org.apache.syncope.common.lib.types.JobType;
24  
25  public class ExecTO extends AbstractStartEndBean implements EntityTO {
26  
27      private static final long serialVersionUID = -4621191979198357081L;
28  
29      private String key;
30  
31      private JobType jobType;
32  
33      private String refKey;
34  
35      private String refDesc;
36  
37      private String status;
38  
39      private String message;
40  
41      private String executor;
42  
43      @Override
44      public String getKey() {
45          return key;
46      }
47  
48      @Override
49      public void setKey(final String key) {
50          this.key = key;
51      }
52  
53      public JobType getJobType() {
54          return jobType;
55      }
56  
57      public void setJobType(final JobType jobType) {
58          this.jobType = jobType;
59      }
60  
61      public String getRefKey() {
62          return refKey;
63      }
64  
65      public void setRefKey(final String refKey) {
66          this.refKey = refKey;
67      }
68  
69      public String getRefDesc() {
70          return refDesc;
71      }
72  
73      public void setRefDesc(final String refDesc) {
74          this.refDesc = refDesc;
75      }
76  
77      public String getMessage() {
78          return message;
79      }
80  
81      public void setMessage(final String message) {
82          this.message = message;
83      }
84  
85      public String getStatus() {
86          return status;
87      }
88  
89      public void setStatus(final String status) {
90          this.status = status;
91      }
92  
93      public String getExecutor() {
94          return executor;
95      }
96  
97      public void setExecutor(final String executor) {
98          this.executor = executor;
99      }
100 
101     @Override
102     public int hashCode() {
103         return new HashCodeBuilder().
104                 appendSuper(super.hashCode()).
105                 append(key).
106                 append(jobType).
107                 append(refKey).
108                 append(refDesc).
109                 append(status).
110                 append(message).
111                 append(executor).
112                 build();
113     }
114 
115     @Override
116     public boolean equals(final Object obj) {
117         if (this == obj) {
118             return true;
119         }
120         if (obj == null) {
121             return false;
122         }
123         if (getClass() != obj.getClass()) {
124             return false;
125         }
126         final ExecTO other = (ExecTO) obj;
127         return new EqualsBuilder().
128                 appendSuper(super.equals(obj)).
129                 append(key, other.key).
130                 append(jobType, other.jobType).
131                 append(refKey, other.refKey).
132                 append(refDesc, other.refDesc).
133                 append(status, other.status).
134                 append(message, other.message).
135                 append(executor, other.executor).
136                 build();
137     }
138 }