cn.ipokerface.aps.response.NotificationResponse Maven / Gradle / Ivy
Show all versions of apple-pns-java Show documentation
package cn.ipokerface.aps.response;
import cn.ipokerface.aps.notification.Notification;
/**
* Created by PokerFace
* Create Date 2020-08-23.
* Email: [email protected]
* Version 1.0.0
*
* Description:
*/
public class NotificationResponse {
private ResponseCode code;
private String apnsId;
private T notification;
private NotificationError error;
public NotificationResponse(ResponseCode code, String apnsId, T notification) {
this.code = code;
this.apnsId = apnsId;
this.notification = notification;
}
public NotificationResponse(ResponseCode code, String apnsId, T notification, NotificationError error) {
this.code = code;
this.apnsId = apnsId;
this.notification = notification;
this.error = error;
}
public T getNotification() {
return notification;
}
public void setNotification(T notification) {
this.notification = notification;
}
public ResponseCode getCode() {
return code;
}
public void setCode(ResponseCode code) {
this.code = code;
}
public NotificationError getError() {
return error;
}
public void setError(NotificationError error) {
this.error = error;
}
public String getApnsId() {
return apnsId;
}
public void setApnsId(String apnsId) {
this.apnsId = apnsId;
}
public boolean isSuccess() {
return this.code != null && this.code.getCode() == ResponseCode.success.getCode();
}
@Override
public String toString() {
return "NotificationResponse{" +
"code=" + code +
", apnsId='" + apnsId + '\'' +
", notification=" + notification +
", error=" + error +
'}';
}
}