package com.twm.tools.local

import java.util.concurrent.Callable

class TranslateCallable(
    private val translateApi: TranslateApi,
    private val source: String,
    private val language: String
): Callable<String?> {

    override fun call(): String? {
        if (source.isEmpty()) {
            return null
        }
        return translateApi.translate(source, language)
    }
}