diff options
author | tang peng <tang.peng5@zte.com.cn> | 2018-08-17 08:38:06 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-08-17 08:38:06 +0000 |
commit | d9c8e3aab483a782e770e96505e6afc3c55a77e1 (patch) | |
tree | 6ec848807c74f322096fedd38aa74547a9904edf /holmes-actions/src | |
parent | ec0a5672d39fc3caed1292abe1c4e1c2f814d2e5 (diff) | |
parent | ade8715b85cc4205ba2420cca24e253891a13540 (diff) |
Merge "Added a clone Method to a Class"
Diffstat (limited to 'holmes-actions/src')
-rw-r--r-- | holmes-actions/src/main/java/org/onap/holmes/common/api/entity/CorrelationRule.java | 55 |
1 files changed, 39 insertions, 16 deletions
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/api/entity/CorrelationRule.java b/holmes-actions/src/main/java/org/onap/holmes/common/api/entity/CorrelationRule.java index d7965c5..acfae35 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/api/entity/CorrelationRule.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/api/entity/CorrelationRule.java @@ -1,12 +1,12 @@ /**
* Copyright 2017 ZTE Corporation.
- *
+ * <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,38 +16,30 @@ package org.onap.holmes.common.api.entity;
import com.google.gson.annotations.SerializedName;
+
+import java.io.Closeable;
import java.util.Date;
import java.util.Properties;
+
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
-public class CorrelationRule {
-
+public class CorrelationRule implements Cloneable {
@SerializedName(value = "ruleid")
private String rid;
@SerializedName(value = "rulename")
private String name;
-
private String description;
-
private int enabled;
-
private long templateID;
-
private String engineID;
-
private String engineType;
-
private String creator;
-
private String modifier;
-
private Properties params;
-
private String content;
-
private String vendor;
@SerializedName(value = "createtime")
private Date createTime;
@@ -59,4 +51,35 @@ public class CorrelationRule { private String closedControlLoopName;
@SerializedName(value = "engineinstance")
private String engineInstance;
+
+ @Override
+ public Object clone() {
+ CorrelationRule r = null;
+ try {
+ r = (CorrelationRule) super.clone();
+ } catch (CloneNotSupportedException e) {
+ // This will never happen.
+ throw new InternalError(e);
+ }
+
+ r.rid = rid == null ? null : rid;
+ r.name = name == null ? null : name;
+ r.description = description == null ? null : description;
+ r.enabled = enabled;
+ r.templateID = templateID;
+ r.engineID = engineID == null ? null : engineID;
+ r.engineType = engineType == null ? null : engineType;
+ r.creator = creator == null ? null : creator;
+ r.modifier = modifier == null ? null : modifier;
+ r.params = params == null ? null : (Properties) params.clone();
+ r.content = content == null ? null : content;
+ r.vendor = vendor == null ? null : vendor;
+ r.createTime = createTime == null ? null : (Date) createTime.clone();
+ r.updateTime = updateTime == null ? null : (Date) updateTime.clone();
+ r.packageName = packageName == null ? null : packageName;
+ r.closedControlLoopName = closedControlLoopName == null ? null : closedControlLoopName;
+ r.engineInstance = engineInstance == null ? null : engineInstance;
+
+ return r;
+ }
}
|