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=14a3f078e7e85a1ac621f354983ce3e4368c3934;hb=e44087456f6b74b61183ff783db6333eb1fe4dd4;hp=c8d61b9bc627ebf76609b18f24eb722c2399f818;hpb=3d9201cd04d80d99d6a79dc471a43a4ac6299166;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 c8d61b9..14a3f07 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. @@ -15,43 +15,70 @@ */ package org.onap.holmes.common.api.entity; -import com.fasterxml.jackson.annotation.JsonProperty; +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 { - - @JsonProperty(value = "ruleid") +public class CorrelationRule implements Cloneable { + @SerializedName(value = "ruleid") private String rid; - @JsonProperty(value = "rulename") + @SerializedName(value = "rulename") private String name; - @JsonProperty private String description; - @JsonProperty private int enabled; - @JsonProperty private long templateID; private String engineID; - @JsonProperty private String engineType; - @JsonProperty private String creator; - @JsonProperty private String modifier; - @JsonProperty private Properties params; - @JsonProperty private String content; - @JsonProperty private String vendor; - @JsonProperty(value = "createtime") + @SerializedName(value = "createtime") private Date createTime; - @JsonProperty(value = "updatetime") + @SerializedName(value = "updatetime") private Date updateTime; - @JsonProperty(value = "package") + @SerializedName(value = "package") 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; + r.name = name; + r.description = description; + r.enabled = enabled; + r.templateID = templateID; + r.engineID = engineID; + r.engineType = engineType; + r.creator = creator; + r.modifier = modifier; + r.params = params == null ? null : (Properties) params.clone(); + r.content = content; + r.vendor = vendor; + r.createTime = createTime == null ? null : (Date) createTime.clone(); + r.updateTime = updateTime == null ? null : (Date) updateTime.clone(); + r.packageName = packageName; + r.closedControlLoopName = closedControlLoopName; + r.engineInstance = engineInstance; + + return r; + } }