package se.arbetsformedlingen.venice.probe;

import se.arbetsformedlingen.venice.common.Application;
import se.arbetsformedlingen.venice.common.Host;
import se.arbetsformedlingen.venice.common.Status;
import se.arbetsformedlingen.venice.common.Version;

import java.time.LocalDateTime;
import java.util.Objects;

public class ProbeResponse {
    private Host host;
    private Application application;
    private Version version;
    private Status status;
    private LocalDateTime checkTimestamp = LocalDateTime.now();

    ProbeResponse(Application application, Host host, Status status, Version version) {
        this.application = application;
        this.host = host;
        this.status = status;
        this.version = version;
    }

    String getHostName() {
        return host.getName();
    }

    String getApplicationName() {
        return application.getApplicationName();
    }

    public String getVersion() {
        return version.getVersion();
    }

    public String getStatus() {
        return status.getStatus();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ProbeResponse that = (ProbeResponse) o;
        return Objects.equals(host, that.host) &&
                Objects.equals(application, that.application) &&
                Objects.equals(version, that.version) &&
                Objects.equals(status, that.status);
    }

    @Override
    public int hashCode() {
        return Objects.hash(host, application, version, status);
    }

    @Override
    public String toString() {
        return "ProbeResponse{" +
                "host=" + host +
                ", application=" + application +
                ", version=" + version +
                ", status=" + status +
                ", checkTimestamp=" + checkTimestamp +
                '}';
    }
}

@@ -747,22 +747,20 @@
     
-String
+Host
  getHost
 Name
@@ -755,20 +755,16 @@
  getHost
-Name
 () %7B%0A   
@@ -783,18 +783,8 @@
 host
-.getName()
 ;%0A  
@@ -792,22 +792,27 @@
  %7D%0A%0A    
-String
+Application
  getAppl
@@ -818,20 +818,16 @@
 lication
-Name
 () %7B%0A   
@@ -853,29 +853,8 @@
 tion
-.getApplicationName()
 ;%0A  
@@ -914,26 +914,24 @@
 version.
-getVersion
+toString
 ();%0A    
@@ -987,25 +987,24 @@
  status.
-getStatus
+toString
 ();%0A    

Return the actual type and not a String