Improved the UT coverage
[holmes/common.git] / holmes-actions / src / main / java / org / onap / holmes / common / api / entity / CorrelationRule.java
1 /**\r
2  * Copyright 2017 ZTE Corporation.\r
3  * <p>\r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  * <p>\r
8  * http://www.apache.org/licenses/LICENSE-2.0\r
9  * <p>\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 package org.onap.holmes.common.api.entity;\r
17 \r
18 import com.google.gson.annotations.SerializedName;\r
19 \r
20 import java.util.Date;\r
21 import java.util.Properties;\r
22 \r
23 import lombok.Getter;\r
24 import lombok.Setter;\r
25 \r
26 @Getter\r
27 @Setter\r
28 public class CorrelationRule implements Cloneable {\r
29     @SerializedName(value = "ruleid")\r
30     private String rid;\r
31     @SerializedName(value = "rulename")\r
32     private String name;\r
33     private String description;\r
34     private int enabled;\r
35     private long templateID;\r
36     private String engineID;\r
37     private String engineType;\r
38     private String creator;\r
39     private String modifier;\r
40     private Properties params;\r
41     private String content;\r
42     private String vendor;\r
43     @SerializedName(value = "createtime")\r
44     private Date createTime;\r
45     @SerializedName(value = "updatetime")\r
46     private Date updateTime;\r
47     @SerializedName(value = "package")\r
48     private String packageName;\r
49     @SerializedName(value = "controlloopname")\r
50     private String closedControlLoopName;\r
51     @SerializedName(value = "engineinstance")\r
52     private String engineInstance;\r
53 \r
54     @Override\r
55     public Object clone() {\r
56         CorrelationRule r = null;\r
57         try {\r
58             r = (CorrelationRule) super.clone();\r
59         } catch (CloneNotSupportedException e) {\r
60             // This will never happen.\r
61             throw new InternalError(e);\r
62         }\r
63 \r
64         r.rid = rid;\r
65         r.name = name;\r
66         r.description = description;\r
67         r.enabled = enabled;\r
68         r.templateID = templateID;\r
69         r.engineID = engineID;\r
70         r.engineType = engineType;\r
71         r.creator = creator;\r
72         r.modifier = modifier;\r
73         r.params = params == null ? null : (Properties) params.clone();\r
74         r.content = content;\r
75         r.vendor = vendor;\r
76         r.createTime = createTime == null ? null : (Date) createTime.clone();\r
77         r.updateTime = updateTime == null ? null : (Date) updateTime.clone();\r
78         r.packageName = packageName;\r
79         r.closedControlLoopName = closedControlLoopName;\r
80         r.engineInstance = engineInstance;\r
81 \r
82         return r;\r
83     }\r
84 }\r