From 4f3309f1f2d17e3cde4544dc9f6325b0d9bfd721 Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Sat, 24 Feb 2024 10:17:22 +1100 Subject: Make hypixel items api response a proper json object #1039 --- .../java/at/hannibal2/skyhanni/utils/JsonUtils.kt | 24 ---------------------- 1 file changed, 24 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/utils') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/JsonUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/JsonUtils.kt index 6cbba135b..e9d755fab 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/JsonUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/JsonUtils.kt @@ -37,27 +37,3 @@ fun JsonObject.getStringOrValue(key: String, alternative: String): String { alternative } } - -fun JsonObject.getStringOrNull(key: String): String? { - return if (has(key)) { - try { - get(key).asString - } catch (_: Exception) { - null - } - } else { - null - } -} - -fun JsonObject.getDoubleOrNull(key: String): Double? { - return if (has(key)) { - try { - get(key).asDouble - } catch (_: Exception) { - null - } - } else { - null - } -} -- cgit