com.windowsazure.messaging.BaiduRegistration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of NotificationHubs Show documentation
Show all versions of NotificationHubs Show documentation
This package contains the JAVA SDK for Azure Notification Hubs.
The newest version!
package com.windowsazure.messaging;
/**
* Class representing a native registration for devices using Baidu PNS.
*
*/
public class BaiduRegistration extends Registration {
private static final String BAIDU_NATIVE_REGISTRATION1 = "";
private static final String BAIDU_NATIVE_REGISTRATION2 = "";
private static final String BAIDU_NATIVE_REGISTRATION3 = " ";
private static final String BAIDU_NATIVE_REGISTRATION4 = " ";
protected String baiduUserId;
protected String baiduChannelId;
public BaiduRegistration() {
this(null, null);
}
public BaiduRegistration(String baiduUserId, String baiduChannelId) {
this(null, baiduUserId, baiduChannelId);
}
public BaiduRegistration(String registrationId, String baiduUserId, String baiduChannelId) {
super(registrationId);
this.baiduUserId = baiduUserId;
this.baiduChannelId = baiduChannelId;
}
public String getBaiduUserId() {
return baiduUserId;
}
public void setBaiduUserId(String baiduUserId) {
this.baiduUserId = baiduUserId;
}
public String getBaiduChannelId() {
return baiduChannelId;
}
public void setBaiduChannelId(String baiduChannelId) {
this.baiduChannelId = baiduChannelId;
}
@Override
public int hashCode() {
String channel = (baiduUserId == null ? "" : baiduUserId) + "-" + (baiduChannelId == null ? "" : baiduChannelId);
final int prime = 31;
int result = super.hashCode();
result = prime
* result
+ ((baiduUserId == null && baiduChannelId == null) ? 0 : channel.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
BaiduRegistration other = (BaiduRegistration) obj;
return baiduUserId.equals(other.baiduUserId) && baiduChannelId.equals(other.baiduChannelId);
}
@Override
public String getXml() {
StringBuffer buf = new StringBuffer();
buf.append(BAIDU_NATIVE_REGISTRATION1);
buf.append(getTagsXml());
buf.append(BAIDU_NATIVE_REGISTRATION2);
buf.append(baiduUserId);
buf.append(BAIDU_NATIVE_REGISTRATION3);
buf.append(baiduChannelId);
buf.append(BAIDU_NATIVE_REGISTRATION4);
return buf.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy