I was experimenting in some global API-parser (to check net-connection, call API & return formatted data by a single call from source) for Android using Kotlin & at some point I had to create a generic type of `object` as like the following snippet, when found the compilation error at the 1st line like `Type parameters are not allowed for objects`:

```
object RestApiParser<T> // ERROR(mark under T): Type parameters are not allowed for objects
: Callback<T> {

    override fun onFailure(call: Call<T>?, t: Throwable?) {
        // bla-bla-blaa codes ...
    }

    override fun onResponse(call: Call<T>?, response: Response<T>?) {
        // bla-bla-blaa codes ...
    }

    fun getResponse(context: Context, call: Call<T>, callback: RestApiCallback<T>) {
       // bla-bla-blaa codes ...
    }

    fun getList(context: Context, call: Call<ArrayList<T>>, callback: RestApiCallback<T>) {
       // bla-bla-blaa codes ...
    }

    // there are more codes like the above ...
}

```

I used `companion object` inside `class` delivering the same error & then had to continue reverting the `RestApiParser` to a simple class & calling that through a variable every time, which didn't satisfy our need.

Yes, singleton structure might be coded like the following companion segment using [upper-bound](https://kotlinlang.org/docs/reference/generics.html#generic-constraints):

```
companion object {
    private var instance: RestApiParser<*>? = null
    fun <T> getParser(): RestApiParser<T> {
        if (instance == null)
            instance = RestApiParser<T>()
        return instance as RestApiParser<T>
    }
}

```

But it would feel good to create generic object in Kotlin.

**Question:**  
Is there any way to **create generic object** in Kotlin? 

If **not**, then what may **best suit** the mentioned scenario?