According to DictionaryInterface.java:
/**
* Note: DictionaryInterface is an internal interface. This should not be public.
*/
public interface DictionaryInterface {
.
.
.
}
I have a lot of extension functions for both Document and Dictionary, and I can use DictionaryInterface instead of these two so I only create a single method. Should we avoid doing this?
e.g.:
fun Document.getDictionaries(key: String): List<Dictionary> {
return getArray(key)?.filterIsInstance<Dictionary>() ?: listOf()
}
fun Dictionary.getDictionaries(key: String): List<Dictionary> {
return getArray(key)?.filterIsInstance<Dictionary>() ?: listOf()
}
vs.
fun DictionaryInterface.getDictionaries(key: String): List<Dictionary> {
return getArray(key)?.filterIsInstance<Dictionary>() ?: listOf()
}