Applied kotlin style conventions

This commit is contained in:
bluefireoly
2020-10-18 18:36:49 +02:00
parent e1d4e8bbfc
commit da848728d2
39 changed files with 509 additions and 385 deletions

View File

@@ -15,13 +15,12 @@ interface SpigotSerialzableCompanion<T>
/**
* @return A json string.
*/
fun SpigotSerializable<*>.serialize(pretty: Boolean = true): String
= ValueHolder.getGson(pretty).toJson(this)
fun SpigotSerializable<*>.serialize(pretty: Boolean = true): String = ValueHolder.getGson(pretty).toJson(this)
/**
* Deserializes the given json string and
* returns the deserialized object.
*/
@Suppress("unused")
inline fun <reified T> SpigotSerialzableCompanion<T>.deserialize(json: String): T
= ValueHolder.getGson(false).fromJson(json, T::class.java)
inline fun <reified T> SpigotSerialzableCompanion<T>.deserialize(json: String): T =
ValueHolder.getGson(false).fromJson(json, T::class.java)