@Test public void testSetCheckedAttribute() throws Exception { JSONObject attributes = new JSONObject(); MPUtility.setCheckedAttribute(attributes, "some key", "some value", false, true); assertEquals("some value", attributes.getString("some key")); MPUtility.setCheckedAttribute(attributes, "some key 2", "some value 2", false, false); assertEquals("some value 2", attributes.getString("some key 2")); }
public static Boolean setCheckedAttribute(JSONObject attributes, String key, Object value, boolean increment, boolean userAttribute) { return setCheckedAttribute(attributes, key, value, false, increment, userAttribute); }
MPUtility { public static Boolean setCheckedAttribute(JSONObject attributes, String key, Object value, boolean increment, boolean userAttribute) { return setCheckedAttribute(attributes, key, value, false, increment, userAttribute); } }
MPUtility { public static Boolean setCheckedAttribute(JSONObject attributes, String key, Object value, boolean increment, boolean userAttribute) { return setCheckedAttribute(attributes, key, value, false, increment, userAttribute); }  }
MPUtility { public static Boolean setCheckedAttribute(JSONObject attributes, String key, Object value, boolean increment, boolean userAttribute) { return setCheckedAttribute(attributes, key, value, false, increment, userAttribute); }  static long getAvailableMemory(Context context); static boolean isSystemMemoryLow(Context context); static long getSystemMemoryThreshold(Context context); static long getRemainingHeapInBytes(); static boolean isEmpty(CharSequence str); static boolean isEmpty(JSONArray jsonArray); static boolean isEmpty(JSONObject jsonObject); static boolean isEmpty(Map map); static boolean isEmpty(Collection collection); @WorkerThread @TargetApi(Build.VERSION_CODES.ECLAIR) static AdIdInfo getAdIdInfo(Context context); static boolean isInDaylightSavings(); static boolean isEqual(Object field, Object field1); static String getGpsEnabled(Context context); @SuppressLint("MissingPermission") static Integer getNetworkType(Context context, TelephonyManager telephonyManager); static long getAvailableInternalDisk(Context context); static long getAvailableExternalDisk(Context context); static String getAppVersionName(Context context); static String hmacSha256Encode(String key, String data); static JSONObject getJsonResponse(MPConnection connection); static JSONObject getJsonResponse(HttpURLConnection connection); static JSONObject getJsonResponse(InputStream is); static long getDiskSpace(Context context, File path); static String getErrorMessage(HttpURLConnection connection); static long millitime(); @TargetApi(Build.VERSION_CODES.CUPCAKE) static String getAndroidID(Context context); static String getTimeZone(); static int getOrientation(Context context); static long getTotalMemory(Context context); @TargetApi(Build.VERSION_CODES.JELLY_BEAN) static long getTotalMemoryJB(Context context); static long getTotalMemoryPreJB(); static String getOpenUDID(Context context); static String getRampUdid(Context context); static boolean isTablet(Context context); static boolean hasNfc(Context context); static String getBluetoothVersion(Context context); static boolean isPhoneRooted(); static int mpHash(String input); static boolean hasTelephony(Context context); @SuppressLint("MissingPermission") static boolean isBluetoothEnabled(Context context); static boolean checkPermission(Context context, String permission); static boolean isGmsAdIdAvailable(); static boolean isSupportLibAvailable(); static Boolean isFirebaseAvailable(); static boolean isInstallRefApiAvailable(); static BigInteger hashFnv1A(byte[] data); static boolean isServiceAvailable(Context context, Class<?> service); static JSONObject wrapExtras(Bundle extras); static JSONObject mapToJson(Map<String, String> map); static boolean isAppDebuggable(Context context); static boolean isDevEnv(); static JSONObject enforceAttributeConstraints(Map<String, String> attributes); static Boolean setCheckedAttribute(JSONObject attributes, String key, Object value, boolean increment, boolean userAttribute); static Boolean setCheckedAttribute(JSONObject attributes, String key, Object value, Boolean caseInsensitive, boolean increment, boolean userAttribute); static String findCaseInsensitiveKey(JSONObject jsonObject, String key); static boolean isInstantApp(final Context context); static boolean containsNullKey(Map map); @Nullable static String getProp(String key); }
MPUtility { public static Boolean setCheckedAttribute(JSONObject attributes, String key, Object value, boolean increment, boolean userAttribute) { return setCheckedAttribute(attributes, key, value, false, increment, userAttribute); }  static long getAvailableMemory(Context context); static boolean isSystemMemoryLow(Context context); static long getSystemMemoryThreshold(Context context); static long getRemainingHeapInBytes(); static boolean isEmpty(CharSequence str); static boolean isEmpty(JSONArray jsonArray); static boolean isEmpty(JSONObject jsonObject); static boolean isEmpty(Map map); static boolean isEmpty(Collection collection); @WorkerThread @TargetApi(Build.VERSION_CODES.ECLAIR) static AdIdInfo getAdIdInfo(Context context); static boolean isInDaylightSavings(); static boolean isEqual(Object field, Object field1); static String getGpsEnabled(Context context); @SuppressLint("MissingPermission") static Integer getNetworkType(Context context, TelephonyManager telephonyManager); static long getAvailableInternalDisk(Context context); static long getAvailableExternalDisk(Context context); static String getAppVersionName(Context context); static String hmacSha256Encode(String key, String data); static JSONObject getJsonResponse(MPConnection connection); static JSONObject getJsonResponse(HttpURLConnection connection); static JSONObject getJsonResponse(InputStream is); static long getDiskSpace(Context context, File path); static String getErrorMessage(HttpURLConnection connection); static long millitime(); @TargetApi(Build.VERSION_CODES.CUPCAKE) static String getAndroidID(Context context); static String getTimeZone(); static int getOrientation(Context context); static long getTotalMemory(Context context); @TargetApi(Build.VERSION_CODES.JELLY_BEAN) static long getTotalMemoryJB(Context context); static long getTotalMemoryPreJB(); static String getOpenUDID(Context context); static String getRampUdid(Context context); static boolean isTablet(Context context); static boolean hasNfc(Context context); static String getBluetoothVersion(Context context); static boolean isPhoneRooted(); static int mpHash(String input); static boolean hasTelephony(Context context); @SuppressLint("MissingPermission") static boolean isBluetoothEnabled(Context context); static boolean checkPermission(Context context, String permission); static boolean isGmsAdIdAvailable(); static boolean isSupportLibAvailable(); static Boolean isFirebaseAvailable(); static boolean isInstallRefApiAvailable(); static BigInteger hashFnv1A(byte[] data); static boolean isServiceAvailable(Context context, Class<?> service); static JSONObject wrapExtras(Bundle extras); static JSONObject mapToJson(Map<String, String> map); static boolean isAppDebuggable(Context context); static boolean isDevEnv(); static JSONObject enforceAttributeConstraints(Map<String, String> attributes); static Boolean setCheckedAttribute(JSONObject attributes, String key, Object value, boolean increment, boolean userAttribute); static Boolean setCheckedAttribute(JSONObject attributes, String key, Object value, Boolean caseInsensitive, boolean increment, boolean userAttribute); static String findCaseInsensitiveKey(JSONObject jsonObject, String key); static boolean isInstantApp(final Context context); static boolean containsNullKey(Map map); @Nullable static String getProp(String key);  }