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

49 lines
1.1 KiB
Java
Raw Normal View History

2015-01-07 13:16:55 +01:00
package de.svenkubiak.jpushover;
public class JPushoverResponse {
2015-01-07 20:11:23 +01:00
private String pushoverResponse;
private int pushoverHttpStatus;
private boolean pushoverSuccessful;
2015-01-07 13:16:55 +01:00
public JPushoverResponse(){
}
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;
}
/**
* The raw Json Response from the pushover API
* @return String
*/
public String getResponse() {
2015-01-07 20:11:23 +01:00
return pushoverResponse;
2015-01-07 13:16:55 +01:00
}
/**
* The HTTP status from the HTTP request
* @return int
*/
public int getHttpStatus() {
2015-01-07 20:11:23 +01:00
return pushoverHttpStatus;
2015-01-07 13:16:55 +01:00
}
/**
* True if request to pushover API returned HTTP code 200, false otherwise
* @return boolen
*/
public boolean isSuccessful() {
2015-01-07 20:11:23 +01:00
return pushoverSuccessful;
2015-01-07 13:16:55 +01:00
}
}