aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/util/Optionalutil.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-09-24 11:40:15 +0200
committerLinnea Gräf <nea@nea.moe>2024-09-24 11:40:15 +0200
commit420f2a61e1cc64d68bf03825e8fd70cf49ac6a01 (patch)
tree540f2beaf99bda96af3c145cbfe81faebba76bee /src/main/kotlin/util/Optionalutil.kt
parent64099bd2628490b06392766c6d1b9425f26788a3 (diff)
downloadFirmament-420f2a61e1cc64d68bf03825e8fd70cf49ac6a01.tar.gz
Firmament-420f2a61e1cc64d68bf03825e8fd70cf49ac6a01.tar.bz2
Firmament-420f2a61e1cc64d68bf03825e8fd70cf49ac6a01.zip
Use weak caches for custom textures
Diffstat (limited to 'src/main/kotlin/util/Optionalutil.kt')
-rw-r--r--src/main/kotlin/util/Optionalutil.kt5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/kotlin/util/Optionalutil.kt b/src/main/kotlin/util/Optionalutil.kt
new file mode 100644
index 0000000..1cef2fe
--- /dev/null
+++ b/src/main/kotlin/util/Optionalutil.kt
@@ -0,0 +1,5 @@
+package moe.nea.firmament.util
+
+import java.util.Optional
+
+fun <T : Any> T?.intoOptional(): Optional<T> = Optional.ofNullable(this)