minor refactorings
This commit is contained in:
@ -46,6 +46,10 @@ public class JPushover {
|
||||
this.priority(Priority.NORMAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new JPushover instance
|
||||
* @return JPushover instance
|
||||
*/
|
||||
public static JPushover build() {
|
||||
return new JPushover();
|
||||
}
|
||||
@ -209,7 +213,7 @@ public class JPushover {
|
||||
|
||||
/**
|
||||
* Callback parameter may be supplied with a publicly-accessible URL that the
|
||||
* Pushover servers will send a request to when the user has acknowledged your
|
||||
* pushover servers will send a request to when the user has acknowledged your
|
||||
* notification.
|
||||
* Only required if priority is set to emergency.
|
||||
*
|
||||
@ -340,9 +344,9 @@ public class JPushover {
|
||||
.add(Constants.EXPIRE.toString(), this.pushoverExpire)
|
||||
.add(Constants.CALLBACK.toString(), this.pushoverCallback)
|
||||
.add(Constants.URLTITLE.toString(), this.pushoverUrlTitle)
|
||||
.add(Constants.PRIORITY.toString(), this.pushoverPriority.get())
|
||||
.add(Constants.PRIORITY.toString(), this.pushoverPriority.toString())
|
||||
.add(Constants.TIMESTAMP.toString(), this.pushoverTimestamp)
|
||||
.add(Constants.SOUND.toString(), this.pushoverSound.get())
|
||||
.add(Constants.SOUND.toString(), this.pushoverSound.toString())
|
||||
.add(Constants.HTML.toString(), this.pushoverHtml ? "1" : "0")
|
||||
.build();
|
||||
|
||||
|
@ -26,24 +26,21 @@ public class JPushoverResponse {
|
||||
}
|
||||
|
||||
/**
|
||||
* The raw Json Response from the pushover API
|
||||
* @return String
|
||||
* @return The pushover response
|
||||
*/
|
||||
public String getResponse() {
|
||||
return pushoverResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP status from the HTTP request
|
||||
* @return int
|
||||
* @return The HTTP status
|
||||
*/
|
||||
public int getHttpStatus() {
|
||||
return pushoverHttpStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* True if the request to the pushover API returned HTTP code 200, false otherwise
|
||||
* @return boolen
|
||||
* @return true if the api returned a HTTP status code 200, false othwise
|
||||
*/
|
||||
public boolean isSuccessful() {
|
||||
return pushoverSuccessful;
|
||||
|
@ -18,7 +18,7 @@ public enum Priority {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String get() {
|
||||
public String toString() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
@ -8,7 +8,7 @@ package de.svenkubiak.jpushover.enums;
|
||||
public enum Sound {
|
||||
PUSHOVER("pushover"),
|
||||
BIKE("bike"),
|
||||
BUGLE("bugke"),
|
||||
BUGLE("bugle"),
|
||||
CASHREGISTET("cashregister"),
|
||||
CLASSICAL("classical"),
|
||||
COSMIC("cosmic"),
|
||||
@ -35,7 +35,7 @@ public enum Sound {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String get() {
|
||||
public String toString() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user