From abe80cc31d5a40ebed743085011fbcda0c1a9a10 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Tue, 23 Apr 2019 15:32:23 -0400 Subject: Issue #1053 - Drop support Android and remove Fennec - Part 1a: Remove mobile/android --- .../thirdparty/com/adjust/sdk/AdjustEvent.java | 112 --------------------- 1 file changed, 112 deletions(-) delete mode 100644 mobile/android/thirdparty/com/adjust/sdk/AdjustEvent.java (limited to 'mobile/android/thirdparty/com/adjust/sdk/AdjustEvent.java') diff --git a/mobile/android/thirdparty/com/adjust/sdk/AdjustEvent.java b/mobile/android/thirdparty/com/adjust/sdk/AdjustEvent.java deleted file mode 100644 index f03718183..000000000 --- a/mobile/android/thirdparty/com/adjust/sdk/AdjustEvent.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.adjust.sdk; - -import java.util.HashMap; -import java.util.Map; - -/** - * Created by pfms on 05/11/14. - */ -public class AdjustEvent { - String eventToken; - Double revenue; - String currency; - Map callbackParameters; - Map partnerParameters; - - private static ILogger logger = AdjustFactory.getLogger(); - - public AdjustEvent(String eventToken) { - if (!checkEventToken(eventToken, logger)) return; - - this.eventToken = eventToken; - } - - public void setRevenue(double revenue, String currency) { - if (!checkRevenue(revenue, currency)) return; - - this.revenue = revenue; - this.currency = currency; - } - - public void addCallbackParameter(String key, String value) { - if (!isValidParameter(key, "key", "Callback")) return; - if (!isValidParameter(value, "value", "Callback")) return; - - if (callbackParameters == null) { - callbackParameters = new HashMap(); - } - - String previousValue = callbackParameters.put(key, value); - - if (previousValue != null) { - logger.warn("key %s was overwritten", key); - } - } - - public void addPartnerParameter(String key, String value) { - if (!isValidParameter(key, "key", "Partner")) return; - if (!isValidParameter(value, "value", "Partner")) return; - - if (partnerParameters == null) { - partnerParameters = new HashMap(); - } - - String previousValue = partnerParameters.put(key, value); - - if (previousValue != null) { - logger.warn("key %s was overwritten", key); - } - } - - public boolean isValid() { - return eventToken != null; - } - - private static boolean checkEventToken(String eventToken, ILogger logger) { - if (eventToken == null) { - logger.error("Missing Event Token"); - return false; - } - if (eventToken.length() != 6) { - logger.error("Malformed Event Token '%s'", eventToken); - return false; - } - return true; - } - - private boolean checkRevenue(Double revenue, String currency) { - if (revenue != null) { - if (revenue < 0.0) { - logger.error("Invalid amount %.4f", revenue); - return false; - } - - if (currency == null) { - logger.error("Currency must be set with revenue"); - return false; - } - if (currency == "") { - logger.error("Currency is empty"); - return false; - } - - } else if (currency != null) { - logger.error("Revenue must be set with currency"); - return false; - } - return true; - } - - private boolean isValidParameter(String attribute, String attributeType, String parameterName) { - if (attribute == null) { - logger.error("%s parameter %s is missing", parameterName, attributeType); - return false; - } - if (attribute == "") { - logger.error("%s parameter %s is empty", parameterName, attributeType); - return false; - } - - return true; - } -} -- cgit v1.2.3