minor refactoring

This commit is contained in:
skubiak 2015-01-08 08:12:55 +01:00
parent 646593ca6d
commit a6a01808b9
6 changed files with 36 additions and 21 deletions

View File

@ -18,6 +18,11 @@ import de.svenkubiak.jpushover.enums.Constants;
import de.svenkubiak.jpushover.enums.Priority; import de.svenkubiak.jpushover.enums.Priority;
import de.svenkubiak.jpushover.enums.Sound; import de.svenkubiak.jpushover.enums.Sound;
/**
*
* @author svenkubiak
*
*/
public class JPushover { public class JPushover {
private static final Logger LOG = LoggerFactory.getLogger(JPushover.class); private static final Logger LOG = LoggerFactory.getLogger(JPushover.class);
@ -39,7 +44,7 @@ public class JPushover {
* Your application's API token * Your application's API token
* (required) * (required)
* *
* @param token * @param token The pushover API token
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover token(String token) { public JPushover token(String token) {
@ -52,7 +57,7 @@ public class JPushover {
* viewable when logged into the @see <a href="https://pushover.net/login">pushover dashboard</a> * viewable when logged into the @see <a href="https://pushover.net/login">pushover dashboard</a>
* (required) * (required)
* *
* @param user * @param user The username
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover user(String user) { public JPushover user(String user) {
@ -64,7 +69,7 @@ public class JPushover {
* Your message * Your message
* (required) * (required)
* *
* @param message * @param message The message to sent
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover message(String message) { public JPushover message(String message) {
@ -77,7 +82,7 @@ public class JPushover {
* rather than all of the user's devices * rather than all of the user's devices
* (optional) * (optional)
* *
* @param device * @param device The device name
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover device(String device) { public JPushover device(String device) {
@ -89,7 +94,7 @@ public class JPushover {
* Your message's title, otherwise your app's name is used * Your message's title, otherwise your app's name is used
* (optional) * (optional)
* *
* @param title * @param title The title
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover title(String title) { public JPushover title(String title) {
@ -101,7 +106,7 @@ public class JPushover {
* A supplementary URL to show with your message * A supplementary URL to show with your message
* (optional) * (optional)
* *
* @param url * @param url The url
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover url(String url) { public JPushover url(String url) {
@ -112,7 +117,7 @@ public class JPushover {
/** /**
* A title for your supplementary URL, otherwise just the URL is shown * A title for your supplementary URL, otherwise just the URL is shown
* *
* @param urlTitle * @param urlTitle The url title
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover urlTitle(String urlTitle) { public JPushover urlTitle(String urlTitle) {
@ -124,7 +129,7 @@ public class JPushover {
* A Unix timestamp of your message's date and time to display to the user, * A Unix timestamp of your message's date and time to display to the user,
* rather than the time your message is received by our API * rather than the time your message is received by our API
* *
* @param timestamp * @param timestamp The Unix timestamp
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover timestamp(String timestamp) { public JPushover timestamp(String timestamp) {
@ -136,7 +141,7 @@ public class JPushover {
* Priority of the message based on the @see <a href="https://pushover.net/api#priority">documentation</a> * Priority of the message based on the @see <a href="https://pushover.net/api#priority">documentation</a>
* (optional) * (optional)
* *
* @param priority * @param priority The priority enum
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover priority(Priority priority) { public JPushover priority(Priority priority) {
@ -149,7 +154,7 @@ public class JPushover {
* the user's default sound choice * the user's default sound choice
* (optional) * (optional)
* *
* @param sound * @param sound THe sound enum
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover sound(Sound sound) { public JPushover sound(Sound sound) {

View File

@ -1,5 +1,10 @@
package de.svenkubiak.jpushover; package de.svenkubiak.jpushover;
/**
*
* @author svenkubiak
*
*/
public class JPushoverResponse { public class JPushoverResponse {
private String pushoverResponse; private String pushoverResponse;
private int pushoverHttpStatus; private int pushoverHttpStatus;
@ -40,7 +45,7 @@ public class JPushoverResponse {
} }
/** /**
* True if request to pushover API returned HTTP code 200, false otherwise * True if the request to the pushover API returned HTTP code 200, false otherwise
* @return boolen * @return boolen
*/ */
public boolean isSuccessful() { public boolean isSuccessful() {

View File

@ -1,5 +1,10 @@
package de.svenkubiak.jpushover.enums; package de.svenkubiak.jpushover.enums;
/**
*
* @author svenkubiak
*
*/
public enum Constants { public enum Constants {
PUSHOVER_URL("https://api.pushover.net/1/messages.json"), PUSHOVER_URL("https://api.pushover.net/1/messages.json"),
MESSAGE("message"), MESSAGE("message"),

View File

@ -1,5 +1,10 @@
package de.svenkubiak.jpushover.enums; package de.svenkubiak.jpushover.enums;
/**
*
* @author svenkubiak
*
*/
public enum Priority { public enum Priority {
LOWEST("-2"), LOWEST("-2"),
LOW("-1"), LOW("-1"),

View File

@ -1,5 +1,10 @@
package de.svenkubiak.jpushover.enums; package de.svenkubiak.jpushover.enums;
/**
*
* @author svenkubiak
*
*/
public enum Sound { public enum Sound {
PUSHOVER("pushover"), PUSHOVER("pushover"),
BIKE("bike"), BIKE("bike"),

View File

@ -1,10 +0,0 @@
package de.svenkubiak.jpushover;
import org.junit.Test;
public class AppTest {
@Test
public void testApp() {
}
}