diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /mobile/android/thirdparty/com/adjust/sdk/AdjustAttribution.java | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'mobile/android/thirdparty/com/adjust/sdk/AdjustAttribution.java')
-rw-r--r-- | mobile/android/thirdparty/com/adjust/sdk/AdjustAttribution.java | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/mobile/android/thirdparty/com/adjust/sdk/AdjustAttribution.java b/mobile/android/thirdparty/com/adjust/sdk/AdjustAttribution.java new file mode 100644 index 000000000..4e3abb017 --- /dev/null +++ b/mobile/android/thirdparty/com/adjust/sdk/AdjustAttribution.java @@ -0,0 +1,62 @@ +package com.adjust.sdk; + +import org.json.JSONObject; + +import java.io.Serializable; + +/** + * Created by pfms on 07/11/14. + */ +public class AdjustAttribution implements Serializable { + private static final long serialVersionUID = 1L; + + public String trackerToken; + public String trackerName; + public String network; + public String campaign; + public String adgroup; + public String creative; + + public static AdjustAttribution fromJson(JSONObject jsonObject) { + if (jsonObject == null) return null; + + AdjustAttribution attribution = new AdjustAttribution(); + + attribution.trackerToken = jsonObject.optString("tracker_token", null); + attribution.trackerName = jsonObject.optString("tracker_name", null); + attribution.network = jsonObject.optString("network", null); + attribution.campaign = jsonObject.optString("campaign", null); + attribution.adgroup = jsonObject.optString("adgroup", null); + attribution.creative = jsonObject.optString("creative", null); + + return attribution; + } + + public boolean equals(Object other) { + if (other == this) return true; + if (other == null) return false; + if (getClass() != other.getClass()) return false; + AdjustAttribution otherAttribution = (AdjustAttribution) other; + + if (!equalString(trackerToken, otherAttribution.trackerToken)) return false; + if (!equalString(trackerName, otherAttribution.trackerName)) return false; + if (!equalString(network, otherAttribution.network)) return false; + if (!equalString(campaign, otherAttribution.campaign)) return false; + if (!equalString(adgroup, otherAttribution.adgroup)) return false; + if (!equalString(creative, otherAttribution.creative)) return false; + return true; + } + + private boolean equalString(String first, String second) { + if (first == null || second == null) { + return first == null && second == null; + } + return first.equals(second); + } + + @Override + public String toString() { + return String.format("tt:%s tn:%s net:%s cam:%s adg:%s cre:%s", + trackerToken, trackerName, network, campaign, adgroup, creative); + } +} |