Add Audit Data Quality Summary
[logging-analytics/pomba/pomba-context-aggregator.git] / src / main / java / org / onap / pomba / contextaggregator / datatypes / DataQualitySummary.java
diff --git a/src/main/java/org/onap/pomba/contextaggregator/datatypes/DataQualitySummary.java b/src/main/java/org/onap/pomba/contextaggregator/datatypes/DataQualitySummary.java
new file mode 100644 (file)
index 0000000..21941cc
--- /dev/null
@@ -0,0 +1,83 @@
+/*\r
+ * ============LICENSE_START===================================================\r
+ * Copyright (c) 2019 Amdocs\r
+ * ============================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *        http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END=====================================================\r
+ */\r
+\r
+package org.onap.pomba.contextaggregator.datatypes;\r
+\r
+import com.google.gson.annotations.Expose;\r
+import com.google.gson.annotations.SerializedName;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+public class DataQualitySummary {\r
+    @Expose\r
+    @SerializedName("status")\r
+    private Status status;\r
+    @Expose\r
+    @SerializedName("errors")\r
+    private List<String> errors = new ArrayList<>();\r
+\r
+    public enum Status {\r
+        ok,\r
+        error\r
+    }\r
+\r
+    public Status getStatus() {\r
+        return this.status;\r
+    }\r
+\r
+    public void setStatus(Status status) {\r
+        this.status = status;\r
+    }\r
+\r
+    public List<String> getErrors() {\r
+        return this.errors;\r
+    }\r
+\r
+    public void setErrors(List<String> errors) {\r
+        this.errors = errors;\r
+    }\r
+\r
+    /**\r
+     * Creates an "ok" DataQualitySummary instance.\r
+     * @return\r
+     */\r
+    public static DataQualitySummary ok() {\r
+        DataQualitySummary result = new DataQualitySummary();\r
+        result.setStatus(Status.ok);\r
+        return result;\r
+    }\r
+\r
+    /**\r
+     * Creates an "error" DataQualitySummary instance.\r
+     * @param errors List of error descriptions\r
+     * @return\r
+     */\r
+    public static DataQualitySummary error(List<String> errors) {\r
+        DataQualitySummary result = new DataQualitySummary();\r
+        result.setStatus(Status.error);\r
+        result.setErrors(errors);\r
+        return result;\r
+    }\r
+\r
+    @Override\r
+    public String toString() {\r
+        return "DataQuality [status=" + this.status + ", errors=" + this.errors + "]";\r
+    }\r
+\r
+}\r