aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-02-24 10:17:22 +1100
committerGitHub <noreply@github.com>2024-02-24 00:17:22 +0100
commit4f3309f1f2d17e3cde4544dc9f6325b0d9bfd721 (patch)
tree78afbbcfeb7c7066a8522cf68b8dc714b29ad765 /src/main/java/at/hannibal2/skyhanni/utils
parent8eac8a1a23221590d6bfb2a8ff918d9318661ef6 (diff)
downloadskyhanni-4f3309f1f2d17e3cde4544dc9f6325b0d9bfd721.tar.gz
skyhanni-4f3309f1f2d17e3cde4544dc9f6325b0d9bfd721.tar.bz2
skyhanni-4f3309f1f2d17e3cde4544dc9f6325b0d9bfd721.zip
Make hypixel items api response a proper json object #1039
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/JsonUtils.kt24
1 files changed, 0 insertions, 24 deletions
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
- }
-}