package org.radarcns.management.service.catalog;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import org.hibernate.validator.constraints.NotEmpty;

public class CatalogSourceType {

    @JsonProperty("assessment_type")
    private String assessmentType;

    @JsonProperty("app_provider")
    private String appProvider;

    @JsonProperty
    private String vendor;

    @JsonProperty
    private String model;

    @JsonProperty
    private String version;

    @JsonProperty
    private String name;

    @JsonProperty
    private String doc;

    @JsonProperty
    private String scope;

    @JsonProperty
    private Map<String, String> properties;

    @JsonProperty
    private List<String> labels;

    @JsonProperty
    @NotEmpty
    private List<CatalogSourceData> data;

    public String getName() {
        return name;
    }

    public String getDoc() {
        return doc;
    }

    public List<String> getLabels() {
        return labels;
    }

    public Map<String, String> getProperties() {
        return properties;
    }

    public String getAppProvider() {
        return appProvider;
    }

    public String getVendor() {
        return vendor;
    }

    public String getModel() {
        return model;
    }

    public String getVersion() {
        return version;
    }

    public String getScope() {
        return scope;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CatalogSourceType producer = (CatalogSourceType) o;
        return Objects.equals(name, producer.name)
                && Objects.equals(doc, producer.doc)
                && Objects.equals(vendor, producer.vendor)
                && Objects.equals(version, producer.version)
                && Objects.equals(scope, producer.scope)
                && Objects.equals(model, producer.model);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, vendor, model, version, scope);
    }

    public List<CatalogSourceData> getData() {
        return data;
    }

    public String getAssessmentType() {
        return assessmentType;
    }

}

@@ -1431,32 +1431,185 @@
 n scope;%0A    %7D%0A%0A
+    public List%3CCatalogSourceData%3E getData() %7B%0A        return data;%0A    %7D%0A%0A    public String getAssessmentType() %7B%0A        return assessmentType;%0A    %7D%0A%0A
     @Override%0A  
@@ -1821,24 +1821,20 @@
 rceType 
-producer
+that
  = (Cata
@@ -1885,44 +1885,106 @@
 als(
-name, producer.name)%0A               
+assessmentType, that.assessmentType) && Objects%0A            .equals(appProvider, that.appProvider)
  && 
@@ -2002,162 +2002,250 @@
 als(
+ven
 do
-c, producer.doc)%0A                && Objects.equals(vendor, producer.vendor)%0A                && Objects.equals(version, producer.version)%0A               
+r, that.vendor) && Objects%0A            .equals(model, that.model) && Objects.equals(version, that.version) && Objects%0A            .equals(name, that.name) && Objects.equals(doc, that.doc) && Objects%0A            .equals(scope, that.scope)
  && 
@@ -2263,86 +2263,122 @@
 als(
-scope, producer.scope)%0A                && Objects.equals(model, producer.model
+properties, that.properties) && Objects%0A            .equals(labels, that.labels) && Objects.equals(data, that.data
 );%0A 
@@ -2421,24 +2421,25 @@
 ashCode() %7B%0A
+%0A
         retu
@@ -2452,210 +2452,146 @@
 ects
-.hash(name, vendor, model, version, scope);%0A    %7D%0A%0A    public List%3CCatalogSourceData%3E getData() %7B%0A        return data;%0A    %7D%0A%0A    public String getAssessmentType() %7B%0A        return assessmentType
+%0A            .hash(assessmentType, appProvider, vendor, model, version, name, doc, scope, properties,%0A                labels, data)
 ;%0A    %7D%0A
 %0A%7D%0A
@@ -2587,11 +2587,10 @@
 ;%0A    %7D%0A
-%0A
 %7D%0A

update equals and hashcode