ModelBuilderInterfaceWriter

class ModelBuilderInterfaceWriter(filer: Filer, types: Types, asyncable: Asyncable, configManager: ConfigManager, elements: Elements) : Asyncable

Creates an interface for a generated model that contains all of the valid setters for building a model in an EpoxyController. This allows us to expose the interface when building a model and hide all of the non applicable junk that shouldn't be used when building a model (eg equals/bind/toString etc)

We can also hide the setters that are legacy from usage with EpoxyAdapter.

Constructors

ModelBuilderInterfaceWriter
Link copied to clipboard
fun ModelBuilderInterfaceWriter(filer: Filer, types: Types, asyncable: Asyncable, configManager: ConfigManager, elements: Elements)

Types

InterfaceDetails
Link copied to clipboard
data class InterfaceDetails(implementingViews: Set<TypeElement>, methodsOnInterface: Set<ModelBuilderInterfaceWriter.MethodDetails>)
MethodDetails
Link copied to clipboard
class MethodDetails(methodSpec: MethodSpec)
A wrapper around MethodSpec that allows us to compare methods with equality that only checks name and param types.
ParamDetails
Link copied to clipboard
class ParamDetails(parameterSpec: ParameterSpec)
A wrapper around ParameterSpec that allows us to compare params with equality that only checks param type.

Functions

filter
Link copied to clipboard
open suspend override fun <T : Any> Iterable<T>.filter(tag: String, parallel: Boolean, block: suspend (T) -> Boolean): List<T>
forEach
Link copied to clipboard
open suspend override fun <T> Iterable<T>.forEach(tag: String, parallel: Boolean, block: suspend (T) -> Unit)
open suspend override fun <K, V> Map<K, V>.forEach(tag: String, parallel: Boolean, block: suspend (K, V) -> Any?)
map
Link copied to clipboard
open suspend override fun <T, R : Any> Iterable<T>.map(tag: String, parallel: Boolean, transform: suspend (T) -> R?): List<R>
open suspend override fun <K, V, R : Any> Map<K, V>.map(tag: String, parallel: Boolean, transform: suspend (K, V) -> R?): List<R>
writeFilesForViewInterfaces
Link copied to clipboard
suspend fun writeFilesForViewInterfaces()
We need to gather information about all of the view interfaces first, and then write the interface classes.
writeInterface
Link copied to clipboard
fun writeInterface(modelInfo: GeneratedModelInfo, methods: MutableList<MethodSpec>): TypeName

Properties

asyncable
Link copied to clipboard
val asyncable: Asyncable
configManager
Link copied to clipboard
val configManager: ConfigManager
coroutineScope
Link copied to clipboard
open override val coroutineScope: CoroutineScope
coroutinesEnabled
Link copied to clipboard
open override val coroutinesEnabled: Boolean
elements
Link copied to clipboard
val elements: Elements
logger
Link copied to clipboard
open override val logger: Logger
types
Link copied to clipboard
val types: Types