Annotation Interface PackageEpoxyConfig
If an instance of this annotation is not found in a package then the default values are used.
See https://github.com/airbnb/epoxy/wiki/Configuration for more details on these options.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanIf true, models in an EpoxyController that use theAutoModelannotation don't need to be explicitly added to the controller with ".addTo".booleanIf true, all classes that containsEpoxyAttributeorEpoxyModelClassannotations in your project must be abstract.booleanIf true, all fields marked withEpoxyAttributemust have a type that implements hashCode and equals (besides the default Object implementation), or the attribute must set DoNotHash as an option. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanstatic final booleanstatic final boolean
-
Field Details
-
REQUIRE_HASHCODE_DEFAULT
static final boolean REQUIRE_HASHCODE_DEFAULT- See Also:
-
REQUIRE_ABSTRACT_MODELS_DEFAULT
static final boolean REQUIRE_ABSTRACT_MODELS_DEFAULT- See Also:
-
IMPLICITLY_ADD_AUTO_MODELS_DEFAULT
static final boolean IMPLICITLY_ADD_AUTO_MODELS_DEFAULT- See Also:
-
-
Element Details
-
requireHashCode
boolean requireHashCodeIf true, all fields marked withEpoxyAttributemust have a type that implements hashCode and equals (besides the default Object implementation), or the attribute must set DoNotHash as an option.Setting this to true is useful for ensuring that all model attributes correctly implement hashCode and equals, or use DoNotHash (eg for click listeners). It is a common mistake to miss these, which leads to invalid model state and incorrect diffing.
The check is done at compile time and compilation will fail if a hashCode validation fails.
Since it is done at compile time this can only check the direct type of the field. Interfaces or classes will pass the check if they either have an abstract hashCode/equals method (since it is assumed that the object at runtime will implement it) or their class hierarchy must have an implementation of hashCode/equals besides the default Object implementation.
If an attribute is an Iterable or Array then the type of object in that collection must implement hashCode/equals.
- Default:
- false
-
requireAbstractModels
boolean requireAbstractModelsIf true, all classes that containsEpoxyAttributeorEpoxyModelClassannotations in your project must be abstract. Otherwise compilation will fail.Forcing models to be abstract can prevent the mistake of using the original model class instead of the generated class.
- Default:
- false
-
implicitlyAddAutoModels
boolean implicitlyAddAutoModelsIf true, models in an EpoxyController that use theAutoModelannotation don't need to be explicitly added to the controller with ".addTo". Instead, they will be added automatically after they are modified.For more details, see the wiki: https://github.com/airbnb/epoxy/wiki/Epoxy-Controller#implicit-adding
- Default:
- false
-