Fix for ETSI_CATALOG onboarding NS package
[integration/csit.git] / plans / so / integration-etsi-testing / so-simulators / sdc-simulator / src / main / java / org / onap / so / sdcsimulator / models / ResourceMetadata.java
diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/ResourceMetadata.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/ResourceMetadata.java
new file mode 100644 (file)
index 0000000..9ff02c4
--- /dev/null
@@ -0,0 +1,82 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2021 Nordix Foundation.
+ * ================================================================================
+ * 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
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.sdcsimulator.models;
+
+import java.io.Serializable;
+import org.springframework.util.ObjectUtils;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ *
+ * @author Waqas Ikram (waqas.ikram@est.tech)
+ *
+ */
+public class ResourceMetadata extends Metadata implements Serializable {
+
+    private static final long serialVersionUID = -6812049917047990700L;
+
+    @JsonProperty("subCategory")
+    private String subCategory;
+
+    public String getSubCategory() {
+        return subCategory;
+    }
+
+    public void setSubCategory(final String subCategory) {
+        this.subCategory = subCategory;
+    }
+
+    public ResourceMetadata subCategory(final String subCategory) {
+        this.subCategory = subCategory;
+        return this;
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + super.hashCode();
+        result = prime * result + ((subCategory == null) ? 0 : subCategory.hashCode());
+
+        return result;
+    }
+
+    @Override
+    public boolean equals(final Object obj) {
+        if (obj instanceof ResourceMetadata) {
+            final ResourceMetadata other = (ResourceMetadata) obj;
+            return super.equals(obj) && ObjectUtils.nullSafeEquals(subCategory, other.subCategory);
+
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        final StringBuilder sb = new StringBuilder();
+        sb.append(super.toString());
+        sb.deleteCharAt(sb.length() - 1);
+        sb.append("    subCategory: ").append(subCategory).append("\n");
+
+        sb.append("}");
+        return sb.toString();
+    }
+
+}