If you think the Android project playnomics-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.playnomics.android.events;
/*fromwww.java2s.com*/import java.util.Date;
import com.playnomics.android.session.GameSessionInfo;
import com.playnomics.android.util.IConfig;
publicclass UserInfoEvent extends ExplicitEvent {
public UserInfoEvent(IConfig config, GameSessionInfo sessionInfo,
String source, String campaign, Date installDate) {
super(config, sessionInfo);
appendParameter(config.getUserInfoSourceKey(), source);
appendParameter(config.getUserInfoCampaignKey(), campaign);
// date should be in EPOCH format
if (installDate != null) {
appendParameter(config.getUserInfoInstallDateKey(),
installDate.getTime());
}
appendParameter(config.getUserInfoTypeKey(), "update");
}
public UserInfoEvent(IConfig config, GameSessionInfo sessionInfo,
String pushRegistrationId) {
super(config, sessionInfo);
appendParameter(config.getUserInfoPushTokenKey(), pushRegistrationId);
appendParameter(config.getUserInfoTypeKey(), "update");
}
public UserInfoEvent(IConfig config, GameSessionInfo sessionInfo,
String key, String value) {
super(config, sessionInfo);
appendParameter(key, value);
appendParameter(config.getUserInfoTypeKey(), "update");
}
public UserInfoEvent(IConfig config, GameSessionInfo sessionInfo) {
super(config, sessionInfo);
appendParameter(config.getUserInfoTypeKey(), "update");
}
publicvoid setGender(String gender) {
if (gender!=null)
appendParameter(config.getUserInfoGenderKey(), gender);
}
publicvoid setBirthYear(int birthYear) {
if (birthYear>0)
appendParameter(config.getUserInfoBirthYearKey(), birthYear);
}
publicvoid setAppVersion(String appVersion) {
if (appVersion!=null)
appendParameter(config.getAppVersionKey(), appVersion);
}
publicvoid setDeviceModel(String deviceModel) {
if (deviceModel!=null)
appendParameter(config.getDeviceModelKey(), deviceModel);
}
publicvoid setDeviceManufacturer(String manufacturer) {
if (manufacturer!=null)
appendParameter(config.getDeviceManufacturerKey(), manufacturer);
}
publicvoid setDeviceOSVersion(String deviceOSVersion) {
if (deviceOSVersion!=null)
appendParameter(config.getDeviceOSVersionKey(), deviceOSVersion);
}
@Override
public String getUrlPath() {
return config.getEventPathUserInfo();
}
}