1580cba6507999a2904fb0fca6bbb96d17ae1874
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceorder / model / orchestrator / ExecutionTask.java
1 /**
2  * Copyright (c) 2018 Orange
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5  * the License. You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10  * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11  * specific language governing permissions and limitations under the License.
12  */
13 package org.onap.nbi.apis.serviceorder.model.orchestrator;
14
15 import java.util.Date;
16 import java.util.Objects;
17 import javax.persistence.Entity;
18 import javax.persistence.GeneratedValue;
19 import javax.persistence.GenerationType;
20 import javax.persistence.Id;
21 import javax.persistence.Lob;
22
23 @Entity
24 public class ExecutionTask {
25
26
27     @Id
28     @GeneratedValue(strategy = GenerationType.AUTO)
29     private Long internalId;
30
31     private String orderItemId;
32
33     private String reliedTasks;
34
35     private Date createDate;
36
37     private Date lastAttemptDate;
38
39     @Lob
40     private String serviceOrderInfoJson;
41
42     public String getServiceOrderInfoJson() {
43         return serviceOrderInfoJson;
44     }
45
46     public void setServiceOrderInfoJson(String serviceOrderInfoJson) {
47         this.serviceOrderInfoJson = serviceOrderInfoJson;
48     }
49
50     public Date getLastAttemptDate() {
51         return lastAttemptDate;
52     }
53
54     public void setLastAttemptDate(Date lastAttemptDate) {
55         this.lastAttemptDate = lastAttemptDate;
56     }
57
58     public String getOrderItemId() {
59         return orderItemId;
60     }
61
62     public void setOrderItemId(String orderItemId) {
63         this.orderItemId = orderItemId;
64     }
65
66     public String getReliedTasks() {
67         return reliedTasks;
68     }
69
70     public void setReliedTasks(String reliedTasks) {
71         this.reliedTasks = reliedTasks;
72     }
73
74     public Long getInternalId() {
75         return internalId;
76     }
77
78     public void setInternalId(Long internalId) {
79         this.internalId = internalId;
80     }
81
82     public Date getCreateDate() {
83         return createDate;
84     }
85
86     public void setCreateDate(Date createDate) {
87         this.createDate = createDate;
88     }
89
90     @Override
91     public boolean equals(Object o) {
92         if (this == o) {
93             return true;
94         }
95         if (o == null || getClass() != o.getClass()) {
96             return false;
97         }
98         ExecutionTask that = (ExecutionTask) o;
99         return Objects.equals(internalId, that.internalId) &&
100             Objects.equals(orderItemId, that.orderItemId) &&
101             Objects.equals(reliedTasks, that.reliedTasks) &&
102             Objects.equals(createDate, that.createDate) &&
103             Objects.equals(lastAttemptDate, that.lastAttemptDate) &&
104             Objects.equals(serviceOrderInfoJson, that.serviceOrderInfoJson);
105     }
106
107     @Override
108     public int hashCode() {
109         return Objects.hash(internalId, orderItemId, reliedTasks, createDate, lastAttemptDate, serviceOrderInfoJson);
110     }
111
112     @Override
113     public String toString() {
114         return "ExecutionTask{" +
115             "internalId=" + internalId +
116             ", orderItemId='" + orderItemId + '\'' +
117             ", reliedTasks='" + reliedTasks + '\'' +
118             ", createDate=" + createDate +
119             ", lastAttemptDate=" + lastAttemptDate +
120             ", serviceOrderInfoJson='" + serviceOrderInfoJson + '\'' +
121             '}';
122     }
123 }