Added support for Glances API and completly reworked API

This commit is contained in:
Sven Kubiak
2018-11-22 14:45:16 +01:00
parent e70aa6ccb6
commit 69632b331f
17 changed files with 1023 additions and 392 deletions

View File

@@ -0,0 +1,48 @@
package de.svenkubiak.jpushover.http;
/**
*
* @author svenkubiak
*
*/
public class PushoverResponse {
private String pushoverResponse;
private int pushoverHttpStatus;
private boolean pushoverSuccessful;
public PushoverResponse response(String response) {
this.pushoverResponse = response;
return this;
}
public PushoverResponse httpStatus(int httpStatus) {
this.pushoverHttpStatus = httpStatus;
return this;
}
public PushoverResponse isSuccessful(boolean successful) {
this.pushoverSuccessful = successful;
return this;
}
/**
* @return The pushover response
*/
public String getResponse() {
return pushoverResponse;
}
/**
* @return The HTTP status
*/
public int getHttpStatus() {
return pushoverHttpStatus;
}
/**
* @return true if the API returned a HTTP status code 200, false otherwise
*/
public boolean isSuccessful() {
return pushoverSuccessful;
}
}