epoxy-processor / com.airbnb.epoxy.processor / ModelBuilderInterfaceWriter

ModelBuilderInterfaceWriter

class ModelBuilderInterfaceWriter : 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.

Types

InterfaceDetails

data class InterfaceDetails

MethodDetails

class MethodDetails

A wrapper around MethodSpec that allows us to compare methods with equality that only checks name and param types. This prevents things like annotations and param name from affecting equality, and gets us closer to checking the actual method signature.

ParamDetails

class ParamDetails

A wrapper around ParameterSpec that allows us to compare params with equality that only checks param type. This prevents things like annotations and param name from affecting equality.

Constructors

<init>

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

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)

Properties

asyncable

val asyncable: Asyncable

configManager

val configManager: ConfigManager

elements

val elements: Elements

types

val types: Types

Functions

writeFilesForViewInterfaces

suspend fun writeFilesForViewInterfaces(): Unit

We need to gather information about all of the view interfaces first, and then write the interface classes.

writeInterface

fun writeInterface(modelInfo: GeneratedModelInfo, methods: MutableList<MethodSpec>): TypeName

Extension Functions

mutex

fun Any.mutex(): Mutex