Skip to content

Commit 24a136a

Browse files
committed
Remove inline reified fun's for compatibility with Java
1 parent ed83221 commit 24a136a

File tree

1 file changed

+6
-6
lines changed
  • src/main/kotlin/net/servicestack/gistcafe

1 file changed

+6
-6
lines changed

src/main/kotlin/net/servicestack/gistcafe/Inspect.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Inspect {
4747
* Return the contents of any JSON serializable object in a human-friendly, readable format
4848
* @param obj the object to serialize
4949
*/
50-
@JvmStatic inline fun <reified T> dump(obj: T): String {
50+
@JvmStatic fun <T> dump(obj: T): String {
5151
val gson = GsonBuilder().setPrettyPrinting().create()
5252
val json = gson.toJson(obj)
5353
return json.replace("\"","")
@@ -57,13 +57,13 @@ class Inspect {
5757
* Prints the contents of any JSON serializable object in a human-friendly, readable format
5858
* @param obj the object to serialize
5959
*/
60-
@JvmStatic inline fun <reified T> printDump(obj: T) = println(dump(obj))
60+
@JvmStatic fun <T> printDump(obj: T) = println(dump(obj))
6161

6262
/**
6363
* Return the list of JSON serializable objects into a human-friendly Ascii Table
6464
* @param objs the rows to use in the Ascii Table
6565
*/
66-
@JvmStatic inline fun <reified T> dumpTable(objs: Iterable<T>, headers:Iterable<String>? = null): String {
66+
@JvmStatic fun <T> dumpTable(objs: Iterable<T>, headers:Iterable<String>? = null): String {
6767
val rows = objs.toList()
6868
val mapRows = toListMap(rows)
6969
val keys = headers ?: allKeys(mapRows)
@@ -114,7 +114,7 @@ class Inspect {
114114
* Return the list of JSON serializable objects into a human-friendly Ascii Table
115115
* @param objs the rows to use in the Ascii Table
116116
*/
117-
@JvmStatic inline fun <reified T> printDumpTable(objs: Iterable<T>, headers:Iterable<String>? = null) = println(dumpTable(objs, headers))
117+
@JvmStatic fun <T> printDumpTable(objs: Iterable<T>, headers:Iterable<String>? = null) = println(dumpTable(objs, headers))
118118

119119
fun allKeys(rows: List<Map<String, Any?>>): List<String> {
120120
val to = ArrayList<String>()
@@ -189,7 +189,7 @@ class Inspect {
189189
* Return list of objects into an untyped Map
190190
* @param objs target List
191191
*/
192-
@JvmStatic inline fun <reified T> toListMap(objs: List<T>): List<Map<String, Any?>> {
192+
@JvmStatic fun <T> toListMap(objs: List<T>): List<Map<String, Any?>> {
193193
val gson = Gson()
194194
val json = gson.toJson(objs)
195195
return gson.fromJson(json, object : TypeToken<List<Map<String, Any?>>>() {}.type)
@@ -199,7 +199,7 @@ class Inspect {
199199
* Return object into an untyped Map
200200
* @param objs target object
201201
*/
202-
@JvmStatic inline fun <reified T> toMap(obj: T): Map<String, Any?> {
202+
@JvmStatic fun <T> toMap(obj: T): Map<String, Any?> {
203203
val gson = Gson()
204204
val json = gson.toJson(obj)
205205
return gson.fromJson(json, object : TypeToken<Map<String, Any?>>() {}.type)

0 commit comments

Comments
 (0)