From 50b09c2d2aa654b9fefe2f53463f61b0be1a80a6 Mon Sep 17 00:00:00 2001
From: Liuchy1
Date: Thu, 17 Mar 2016 13:11:19 +0800
Subject: [PATCH] fix comment
---
src/main/java/cn/jpush/api/JPushClient.java | 25 ++++------------
.../cn/jpush/api/push/model/PushPayload.java | 7 ++++-
.../java/cn/jpush/api/push/model/SMS.java | 2 +-
.../model/notification/IosNotification.java | 5 ++++
.../push/model/notification/Notification.java | 30 ++++---------------
5 files changed, 23 insertions(+), 46 deletions(-)
diff --git a/src/main/java/cn/jpush/api/JPushClient.java b/src/main/java/cn/jpush/api/JPushClient.java
index 48880620..69d97ede 100644
--- a/src/main/java/cn/jpush/api/JPushClient.java
+++ b/src/main/java/cn/jpush/api/JPushClient.java
@@ -593,10 +593,7 @@ public PushResult sendIosNotificationWithRegistrationID(JsonObject alert, SMS sm
// ---------------------- shortcuts - message
-
- /**
- * Shortcut
- */
+
public PushResult sendMessageAll(String msgContent) throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.messageAll(msgContent);
return _pushClient.sendPush(payload);
@@ -616,10 +613,7 @@ public PushResult sendMessageAll(String msgContent, SMS sms) throws APIConnectio
PushPayload payload = PushPayload.messageAll(msgContent, sms);
return _pushClient.sendPush(payload);
}
-
- /**
- * Shortcut
- */
+
public PushResult sendAndroidMessageWithAlias(String title, String msgContent, String... alias)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
@@ -658,10 +652,7 @@ public PushResult sendAndroidMessageWithAlias(String title, String msgContent, S
.build();
return _pushClient.sendPush(payload);
}
-
- /**
- * Shortcut
- */
+
public PushResult sendAndroidMessageWithRegistrationID(String title, String msgContent, String... registrationID)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
@@ -700,10 +691,7 @@ public PushResult sendAndroidMessageWithRegistrationID(String title, String msgC
.build();
return _pushClient.sendPush(payload);
}
-
- /**
- * Shortcut
- */
+
public PushResult sendIosMessageWithAlias(String title, String msgContent, String... alias)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
@@ -742,7 +730,7 @@ public PushResult sendIosMessageWithAlias(String title, String msgContent, SMS s
.build();
return _pushClient.sendPush(payload);
}
-
+
public PushResult sendIosMessageWithRegistrationID(String title, String msgContent, String... registrationID)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
@@ -782,9 +770,6 @@ public PushResult sendIosMessageWithRegistrationID(String title, String msgConte
return _pushClient.sendPush(payload);
}
- /**
- * Shortcut
- */
public PushResult sendMessageWithRegistrationID(String title, String msgContent, String... registrationID)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
diff --git a/src/main/java/cn/jpush/api/push/model/PushPayload.java b/src/main/java/cn/jpush/api/push/model/PushPayload.java
index 33b18dec..c8d66c4f 100644
--- a/src/main/java/cn/jpush/api/push/model/PushPayload.java
+++ b/src/main/java/cn/jpush/api/push/model/PushPayload.java
@@ -51,9 +51,10 @@ private PushPayload(Platform platform, Audience audience,
this.options = options;
this.sms = sms;
}
-
+
/**
* The entrance for building a PushPayload object.
+ * @return PushPayload builder
*/
public static Builder newBuilder() {
return new Builder();
@@ -61,6 +62,8 @@ public static Builder newBuilder() {
/**
* The shortcut of building a simple alert notification object to all platforms and all audiences
+ * @param alert The alert message.
+ * @return PushPayload
*/
public static PushPayload alertAll(String alert) {
return new Builder()
@@ -80,6 +83,8 @@ public static PushPayload alertAll(String alert, SMS sms) {
/**
* The shortcut of building a simple message object to all platforms and all audiences
+ * @param msgContent The message content.
+ * @return PushPayload
*/
public static PushPayload messageAll(String msgContent) {
return new Builder()
diff --git a/src/main/java/cn/jpush/api/push/model/SMS.java b/src/main/java/cn/jpush/api/push/model/SMS.java
index dac446e5..db7efedb 100644
--- a/src/main/java/cn/jpush/api/push/model/SMS.java
+++ b/src/main/java/cn/jpush/api/push/model/SMS.java
@@ -27,7 +27,7 @@ public static Builder newBuilder() {
*
* @param content The SMS content.
* @param delayTime The seconds you want to delay, should be greater than or equal to 0.
- * @return
+ * @return SMS payload.
*/
public static SMS content(String content, int delayTime) {
return new Builder()
diff --git a/src/main/java/cn/jpush/api/push/model/notification/IosNotification.java b/src/main/java/cn/jpush/api/push/model/notification/IosNotification.java
index 92af6169..3d2f5302 100644
--- a/src/main/java/cn/jpush/api/push/model/notification/IosNotification.java
+++ b/src/main/java/cn/jpush/api/push/model/notification/IosNotification.java
@@ -11,16 +11,20 @@
* APNs 通知类
*
* 支持 APNs 默认的几个参数:
+ *
* - alert: 继承自父类 PlatformNotification 的 alert 属性;本类设置则覆盖。
* - badge: 支持 setBadge(int) 方法来设置;支持 incrBadge(int) 方法来增加。
* - sound: 支持 setSound(string) 方法来设置声音文件。
* - content-available: 用来支持后台推送。如果该值赋值为 1,表示开启后台推送。
* - extras: JSON object. 支持更多的自定义字段信息。
+ *
*
*
* 需要特别留意的是,JPush SDK 会对以下几个值有特别的默认设置考虑:
+ *
* - badge: 默认为 "+1"。如果需要取消 badge 值,需要显式地调用 disableBadge().
* - sound: 默认为 "",即默认的声音提示。如果需要取消 sound 值,即不要声音,需要显式地调用 disableSound().
+ *
*
*/
public class IosNotification extends PlatformNotification {
@@ -152,6 +156,7 @@ public Builder setBadge(int badge) {
/**
* equals to: +1
+ * @return IosNotification builder
*/
public Builder autoBadge() {
return incrBadge(1);
diff --git a/src/main/java/cn/jpush/api/push/model/notification/Notification.java b/src/main/java/cn/jpush/api/push/model/notification/Notification.java
index 4134a7ac..0ecddb69 100644
--- a/src/main/java/cn/jpush/api/push/model/notification/Notification.java
+++ b/src/main/java/cn/jpush/api/push/model/notification/Notification.java
@@ -33,10 +33,7 @@ public static Builder newBuilder() {
public static Notification alert(Object alert) {
return newBuilder().setAlert(alert).build();
}
-
- /**
- * shortcut
- */
+
public static Notification android(String alert, String title, Map extras) {
return newBuilder()
.addPlatformNotification(AndroidNotification.newBuilder()
@@ -46,10 +43,7 @@ public static Notification android(String alert, String title, Map extras) {
return newBuilder()
.addPlatformNotification(IosNotification.newBuilder()
@@ -58,10 +52,7 @@ public static Notification ios(Object alert, Map extras) {
.build())
.build();
}
-
- /**
- * shortcut
- */
+
public static Notification ios_auto_badge() {
return newBuilder()
.addPlatformNotification(IosNotification.newBuilder()
@@ -70,10 +61,7 @@ public static Notification ios_auto_badge() {
.build())
.build();
}
-
- /**
- * shortcut
- */
+
public static Notification ios_set_badge(int badge) {
return newBuilder()
.addPlatformNotification(IosNotification.newBuilder()
@@ -82,10 +70,7 @@ public static Notification ios_set_badge(int badge) {
.build())
.build();
}
-
- /**
- * shortcut
- */
+
public static Notification ios_incr_badge(int badge) {
return newBuilder()
.addPlatformNotification(IosNotification.newBuilder()
@@ -94,10 +79,7 @@ public static Notification ios_incr_badge(int badge) {
.build())
.build();
}
-
- /**
- * shortcut
- */
+
public static Notification winphone(String alert, Map extras) {
return newBuilder()
.addPlatformNotification(WinphoneNotification.newBuilder()