Back to project page WarDroid.
The source code is released under:
MIT License
If you think the Android project WarDroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.deathsnacks.wardroid.utils.gcmclasses; //from ww w . j a v a 2s. co m import java.util.ArrayList; import java.util.List; /** * Created by Admin on 24/02/14. */ public class Alert { private String id; private String node; private String region; private String mission; public String getId() { return id; } public String getNode() { return node; } public String getRegion() { return region; } public String getMission() { return mission; } public String getFaction() { return faction; } public long getActivation() { return activation; } public long getExpiry() { return expiry; } public String[] getRewards() { return rewards; } public String[] getRewardsStripped() { List<String> rewardsTemp = new ArrayList<String>(); for (String reward : rewards) { rewardsTemp.add(reward.replaceAll("\\d+ ", "")); } return rewardsTemp.toArray(new String[rewardsTemp.size()]); } private String faction; private long activation; private long expiry; private String[] rewards; public Alert(String raw) { String[] data = raw.split("\\|"); id = data[0]; node = data[1]; region = data[2]; mission = data[3]; faction = data[4]; activation = Long.parseLong(data[5]); expiry = Long.parseLong(data[6]); rewards = data[7].split(" - "); } }