X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=holmes-actions%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fholmes%2Fcommon%2Fapi%2Fentity%2FCorrelationRule.java;h=db6c19f69f202b01b8759dbc4d10d294ddca4260;hb=4f48419205730ecc3e34d93efc99cd76b81f9a59;hp=0343dfa9ba14985d9ca726834dae0a37b843e870;hpb=37630177bc70661ce86cb12e9af34e8c09893f4d;p=holmes%2Fcommon.git 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 0343dfa..db6c19f 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. - * + *

* 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 - * + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

* 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,29 @@ package org.onap.holmes.common.api.entity; import com.google.gson.annotations.SerializedName; + 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; @@ -57,4 +48,37 @@ public class CorrelationRule { private String packageName; @SerializedName(value = "controlloopname") 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; + } }