<Best way to implement multiple functions for diff...
# forum
r
Best way to implement multiple functions for different type arguments without making the number of implementations grow exponentially? I have this class: data class BluetoothCommand( val characteristic: DeviceUUIDs.Characteristic, override val code: Int, val commandArgument: CommandArgument, val description: String, private val successResponse: BluetoothSuccessResponse = BluetoothSuccessResponse.Default, val errorResponse: BluetoothErrorResponse = BluetoothErrorResponse.Default, val msgSize: Int? = null, val hidden: Boolean = false, val debug: Boolean = false ) : WithCode {...