I am trying to write an interface for REST controllers called GetOne right now this consists of a single method getOne
fun <T> getOne(vararg args : Any) : ResponseEntity<RestResponse<T>>
Ideally I would like to be able to implement this method in any REST controller that has a method for getting one item by id.
While my return type works fine, the method itself can have any number of arguments that are annotated in Spring to map / serialize the fields to the RequestBody / Path Variables / Query Parameters.
I thought I would be able to represent this in my interface as varargs , but this just results in the compiler expecting me to specifically have varargs in my method signature.
Is there a proper way to express this, or can you not do this in kotlin?