@Target(value=TYPE)
@Retention(value=CLASS)
public @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.
| Modifier and Type | Fields and Description |
|---|---|
static boolean |
IMPLICITLY_ADD_AUTO_MODELS_DEFAULT |
static boolean |
REQUIRE_ABSTRACT_MODELS_DEFAULT |
static boolean |
REQUIRE_HASHCODE_DEFAULT |
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
implicitlyAddAutoModels
If true, models in an EpoxyController that use the
AutoModel annotation don't need to
be explicitly added to the controller with ".addTo". |
boolean |
requireAbstractModels
If true, all classes that contains
EpoxyAttribute or EpoxyModelClass annotations in your project must be abstract. |
boolean |
requireHashCode
If true, all fields marked with
EpoxyAttribute must have a type that
implements hashCode and equals (besides the default Object implementation), or the attribute
must set DoNotHash as an option. |
public abstract boolean requireHashCode
EpoxyAttribute must 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.
public abstract boolean requireAbstractModels
EpoxyAttribute or EpoxyModelClass annotations 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.
public abstract boolean implicitlyAddAutoModels
AutoModel annotation 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