Annotation Type PackageEpoxyConfig
-
@Target(TYPE) @Retention(CLASS) public @interface PackageEpoxyConfigUse this annotation on any class or interface in your package to specify default behavior for the Epoxy annotation processor for that package. You can only have one instance of this annotation per package.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.
-
-
Field Summary
Fields Modifier and Type Fields Description static booleanIMPLICITLY_ADD_AUTO_MODELS_DEFAULTstatic booleanREQUIRE_ABSTRACT_MODELS_DEFAULTstatic booleanREQUIRE_HASHCODE_DEFAULT
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanimplicitlyAddAutoModelsIf true, models in an EpoxyController that use theAutoModelannotation don't need to be explicitly added to the controller with ".addTo".booleanrequireAbstractModelsIf true, all classes that containsEpoxyAttributeorEpoxyModelClassannotations in your project must be abstract.booleanrequireHashCodeIf 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.
-
-
-
Element Detail
-
requireHashCode
boolean requireHashCode
If 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 requireAbstractModels
If 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 implicitlyAddAutoModels
If 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
-
-