minor refactorings

This commit is contained in:
Sven Kubiak 2015-12-10 11:22:15 +01:00
parent de59b39be5
commit fac3ee3737
5 changed files with 20 additions and 16 deletions

View File

@ -61,7 +61,7 @@ public class JPushover {
* @param token The pushover API token * @param token The pushover API token
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover token(String token) { public final JPushover token(String token) {
this.pushoverToken = token; this.pushoverToken = token;
return this; return this;
} }
@ -74,7 +74,7 @@ public class JPushover {
* @param user The username * @param user The username
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover user(String user) { public final JPushover user(String user) {
this.pushoverUser = user; this.pushoverUser = user;
return this; return this;
} }
@ -86,7 +86,7 @@ public class JPushover {
* @param retry Number of seconds * @param retry Number of seconds
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover retry(String retry) { public final JPushover retry(String retry) {
this.pushoverRetry = retry; this.pushoverRetry = retry;
return this; return this;
} }
@ -98,7 +98,7 @@ public class JPushover {
* @param expire Number of seconds * @param expire Number of seconds
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover expire(String expire) { public final JPushover expire(String expire) {
this.pushoverExpire = expire; this.pushoverExpire = expire;
return this; return this;
} }
@ -110,7 +110,7 @@ public class JPushover {
* @param message The message to sent * @param message The message to sent
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover message(String message) { public final JPushover message(String message) {
this.pushoverMessage = message; this.pushoverMessage = message;
return this; return this;
} }
@ -123,7 +123,7 @@ public class JPushover {
* @param device The device name * @param device The device name
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover device(String device) { public final JPushover device(String device) {
this.pushoverDevice = device; this.pushoverDevice = device;
return this; return this;
} }
@ -135,7 +135,7 @@ public class JPushover {
* @param title The title * @param title The title
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover title(String title) { public final JPushover title(String title) {
this.pushoverTitle = title; this.pushoverTitle = title;
return this; return this;
} }
@ -147,7 +147,7 @@ public class JPushover {
* @param url The url * @param url The url
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover url(String url) { public final JPushover url(String url) {
this.pushoverUrl = url; this.pushoverUrl = url;
return this; return this;
} }
@ -158,7 +158,7 @@ public class JPushover {
* *
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover html() { public final JPushover html() {
this.pushoverHtml = true; this.pushoverHtml = true;
return this; return this;
} }
@ -169,7 +169,7 @@ public class JPushover {
* @param urlTitle The url title * @param urlTitle The url title
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover urlTitle(String urlTitle) { public final JPushover urlTitle(String urlTitle) {
this.pushoverUrlTitle = urlTitle; this.pushoverUrlTitle = urlTitle;
return this; return this;
} }
@ -181,7 +181,7 @@ public class JPushover {
* @param timestamp The Unix timestamp * @param timestamp The Unix timestamp
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover timestamp(String timestamp) { public final JPushover timestamp(String timestamp) {
this.pushoverTimestamp = timestamp; this.pushoverTimestamp = timestamp;
return this; return this;
} }
@ -193,7 +193,7 @@ public class JPushover {
* @param priority The priority enum * @param priority The priority enum
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover priority(Priority priority) { public final JPushover priority(Priority priority) {
this.pushoverPriority = priority; this.pushoverPriority = priority;
return this; return this;
} }
@ -206,7 +206,7 @@ public class JPushover {
* @param sound THe sound enum * @param sound THe sound enum
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover sound(Sound sound) { public final JPushover sound(Sound sound) {
this.pushoverSound = sound; this.pushoverSound = sound;
return this; return this;
} }
@ -220,7 +220,7 @@ public class JPushover {
* @param callback The callback URL * @param callback The callback URL
* @return JPushover instance * @return JPushover instance
*/ */
public JPushover callback(String callback) { public final JPushover callback(String callback) {
this.pushoverCallback = callback; this.pushoverCallback = callback;
return this; return this;
} }
@ -277,7 +277,7 @@ public class JPushover {
return pushoverSound; return pushoverSound;
} }
public boolean getHtml() { public boolean isHtml() {
return pushoverHtml; return pushoverHtml;
} }

View File

@ -29,6 +29,7 @@ public enum Constants {
this.value = value; this.value = value;
} }
@Override
public String toString() { public String toString() {
return this.value; return this.value;
} }

View File

@ -18,6 +18,7 @@ public enum Priority {
this.value = value; this.value = value;
} }
@Override
public String toString() { public String toString() {
return this.value; return this.value;
} }

View File

@ -35,6 +35,7 @@ public enum Sound {
this.value = value; this.value = value;
} }
@Override
public String toString() { public String toString() {
return this.value; return this.value;
} }

View File

@ -1,6 +1,7 @@
package de.svenkubiak.jpushover; package de.svenkubiak.jpushover;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Test; import org.junit.Test;
@ -64,6 +65,6 @@ public class TestJPushover {
assertEquals(push.getUser(), USER); assertEquals(push.getUser(), USER);
push.html(); push.html();
assertEquals(push.getHtml(), true); assertTrue(push.isHtml());
} }
} }