cn.ipokerface.aps.notification.NotificationAlert Maven / Gradle / Ivy
Show all versions of apple-pns-java Show documentation
package cn.ipokerface.aps.notification;
import com.alibaba.fastjson.annotation.JSONField;
/**
* Created by PokerFace
* Create Date 2020-08-23.
* Email: [email protected]
* Version 1.0.0
*
* Description:
*/
public class NotificationAlert {
/**
* The title of the notification. Apple Watch displays this string in the short look notification interface.
* Specify a string that is quickly understood by the user.
*/
private String title;
/**
* Additional information that explains the purpose of the notification.
*
*/
private String subtitle;
/**
* The content of the alert message.
*
*/
private String body;
/**
* The name of the launch image file to display. If the user chooses to launch your app, the contents of the
* specified image or storyboard file are displayed instead of your app's normal launch image.
*/
@JSONField(name = "launch-image")
private String launchImage;
/**
* The key for a localized title string. Specify this key instead of the title key to retrieve the title from your
* app’s Localizable.strings files. The value must contain the name of a key in your strings file.
*/
@JSONField(name = "title-loc-key")
private String titleLockKey;
/**
* An array of strings containing replacement values for variables in your title string. Each %@ character in
* the string specified by the title-loc-key is replaced by a value from this array. The first item in the array
* replaces the first instance of the %@ character in the string, the second item replaces the second instance, and so on.
*
*/
@JSONField(name = "title-loc-args")
private String[] titleLockArgs;
/**
* The key for a localized subtitle string. Use this key, instead of the subtitle key, to retrieve the subtitle from
* your app's Localizable.strings file. The value must contain the name of a key in your strings file.
*/
@JSONField(name = "subtitle-loc-key")
private String subtitleLockKey;
/**
* An array of strings containing replacement values for variables in your title string. Each %@ character in the
* string specified by subtitle-loc-key is replaced by a value from this array. The first item in the array replaces
* the first instance of the %@ character in the string, the second item replaces the second instance, and so on.
*
*/
@JSONField(name = "subtitle-loc-args")
private String[] subtitleLockArgs;
/**
* The key for a localized message string. Use this key, instead of the body key, to retrieve the message text from
* your app's Localizable.strings file. The value must contain the name of a key in your strings file.
*/
@JSONField(name = "loc-key")
private String lockKey;
/**
*An array of strings containing replacement values for variables in your message text. Each %@ character in the
* string specified by loc-key is replaced by a value from this array. The first item in the array replaces the first
* instance of the %@ character in the string, the second item replaces the second instance, and so on.
*/
@JSONField(name = "loc-args")
private String[] lockArgs;
private NotificationAlert(){}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getSubtitle() {
return subtitle;
}
public void setSubtitle(String subtitle) {
this.subtitle = subtitle;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public String getLaunchImage() {
return launchImage;
}
public void setLaunchImage(String launchImage) {
this.launchImage = launchImage;
}
public String getTitleLockKey() {
return titleLockKey;
}
public void setTitleLockKey(String titleLockKey) {
this.titleLockKey = titleLockKey;
}
public String[] getTitleLockArgs() {
return titleLockArgs;
}
public void setTitleLockArgs(String[] titleLockArgs) {
this.titleLockArgs = titleLockArgs;
}
public String getSubtitleLockKey() {
return subtitleLockKey;
}
public void setSubtitleLockKey(String subtitleLockKey) {
this.subtitleLockKey = subtitleLockKey;
}
public String[] getSubtitleLockArgs() {
return subtitleLockArgs;
}
public void setSubtitleLockArgs(String[] subtitleLockArgs) {
this.subtitleLockArgs = subtitleLockArgs;
}
public String getLockKey() {
return lockKey;
}
public void setLockKey(String lockKey) {
this.lockKey = lockKey;
}
public String[] getLockArgs() {
return lockArgs;
}
public void setLockArgs(String[] lockArgs) {
this.lockArgs = lockArgs;
}
public static class Builder {
private String title;
private String subtitle;
private String body;
private String launchImage;
private String titleLockKey;
private String[] titleLockArgs;
private String subtitleLockKey;
private String[] subtitleLockArgs;
private String lockKey;
private String[] lockArgs;
public Builder(){
}
public Builder title(String title) {
this.title = title;
return this;
}
public Builder subtitle(String subtitle) {
this.subtitle = subtitle;
return this;
}
public Builder body(String body) {
this.body = body;
return this;
}
public Builder launchImage(String launchImage) {
this.launchImage = launchImage;
return this;
}
public Builder titleLockKey(String titleLockKey) {
this.titleLockKey = titleLockKey;
return this;
}
public Builder titleLockArgs(String ...titleLockArgs) {
this.titleLockArgs = titleLockArgs;
return this;
}
public Builder subtitleLockKey(String subtitleLockKey) {
this.subtitleLockKey = subtitleLockKey;
return this;
}
public Builder subtitleLockArgs(String ...subtitleLockArgs) {
this.subtitleLockArgs = subtitleLockArgs;
return this;
}
public Builder lockKey(String lockKey) {
this.lockKey = lockKey;
return this;
}
public Builder lockArgs(String ...lockArgs) {
this.lockArgs = lockArgs;
return this;
}
public NotificationAlert build(){
NotificationAlert alert = new NotificationAlert();
alert.title = this.title;
alert.subtitle = this.subtitle;
alert.body = this.body;
alert.launchImage = this.launchImage;
alert.titleLockKey = this.titleLockKey;
alert.titleLockArgs = this.titleLockArgs;
alert.subtitleLockKey = this.subtitleLockKey;
alert.subtitleLockArgs = this.subtitleLockArgs;
alert.lockKey = this.lockKey;
alert.lockArgs = this.lockArgs;
return alert;
}
}
}