JPushover11/src/main/java/de/svenkubiak/jpushover/JPushoverResponse.java

48 lines
1.0 KiB
Java
Raw Normal View History

2015-01-07 13:16:55 +01:00
package de.svenkubiak.jpushover;
2015-01-08 08:12:55 +01:00
/**
2015-12-08 22:03:44 +01:00
*
2015-01-08 08:12:55 +01:00
* @author svenkubiak
*
*/
2015-01-07 13:16:55 +01:00
public class JPushoverResponse {
2015-01-07 20:11:23 +01:00
private String pushoverResponse;
private int pushoverHttpStatus;
private boolean pushoverSuccessful;
2015-12-08 22:03:44 +01:00
2015-01-07 13:16:55 +01:00
public JPushoverResponse response(String response) {
2015-01-07 20:11:23 +01:00
this.pushoverResponse = response;
2015-01-07 13:16:55 +01:00
return this;
}
public JPushoverResponse httpStatus(int httpStatus) {
2015-01-07 20:11:23 +01:00
this.pushoverHttpStatus = httpStatus;
2015-01-07 13:16:55 +01:00
return this;
}
public JPushoverResponse isSuccessful(boolean successful) {
2015-01-07 20:11:23 +01:00
this.pushoverSuccessful = successful;
2015-01-07 13:16:55 +01:00
return this;
}
/**
2015-12-10 11:17:36 +01:00
* @return The pushover response
2015-01-07 13:16:55 +01:00
*/
public String getResponse() {
2015-01-07 20:11:23 +01:00
return pushoverResponse;
2015-01-07 13:16:55 +01:00
}
/**
2015-12-10 11:17:36 +01:00
* @return The HTTP status
2015-01-07 13:16:55 +01:00
*/
public int getHttpStatus() {
2015-01-07 20:11:23 +01:00
return pushoverHttpStatus;
2015-01-07 13:16:55 +01:00
}
/**
2015-12-10 11:17:36 +01:00
* @return true if the api returned a HTTP status code 200, false othwise
2015-01-07 13:16:55 +01:00
*/
public boolean isSuccessful() {
2015-01-07 20:11:23 +01:00
return pushoverSuccessful;
2015-01-07 13:16:55 +01:00
}
}