package org.pdxfinder.services.reporting;

/*
 * Created by csaba on 26/02/2019.
 */
public class LogEntity {

    //the java class that reported the issue
    private String reporter;

    private String dataSource;
    private String model;

    public LogEntity(String reporter, String dataSource, String model) {
        this.reporter = reporter;
        this.dataSource = dataSource;
        this.model = model;

    }

    @Override
    public String toString() {
        return "{" +
                "reporter='" + reporter + '\'' +
                ", dataSource='" + dataSource + '\'' +
                ", model='" + model + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        LogEntity logEntity = (LogEntity) o;

        if (!reporter.equals(logEntity.reporter)) return false;
        if (!dataSource.equals(logEntity.dataSource)) return false;
        return model.equals(logEntity.model);
    }

    @Override
    public int hashCode() {
        int result = reporter.hashCode();
        result = 31 * result + dataSource.hashCode();
        result = 31 * result + model.hashCode();
        return result;
    }

    public String getReporter() {
        return reporter;
    }

    public void setReporter(String reporter) {
        this.reporter = reporter;
    }

    public String getDataSource() {
        return dataSource;
    }

    public void setDataSource(String dataSource) {
        this.dataSource = dataSource;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }



}

@@ -233,24 +233,132 @@
 ing model;%0A%0A
+    //EG: INFO, ERROR, etc%0A    private String type;%0A%0A    //Additional message;%0A    private String message;%0A%0A
     public L
@@ -410,32 +410,32 @@
 String model) %7B%0A
-
         this.rep
@@ -513,24 +513,79 @@
 del = model;
+%0A        this.type = %22INFO%22;%0A        this.message = %22%22;
 %0A%0A    %7D%0A%0A   
@@ -647,16 +647,16 @@
 n %22%7B%22 +%0A
-
         
@@ -664,16 +664,59 @@
        %22
+type='%22 + type + '%5C'' +%0A                %22, 
 reporter
@@ -1927,12 +1927,287 @@
 %0A    %7D%0A%0A
-%0A
+    public String getType() %7B%0A        return type;%0A    %7D%0A%0A    public void setType(String type) %7B%0A        this.type = type;%0A    %7D%0A%0A    public String getMessage() %7B%0A        return message;%0A    %7D%0A%0A    public void setMessage(String message) %7B%0A        this.message = message;%0A    %7D
 %0A%7D%0A

Add message and type to log base class