Annotation Type PackageEpoxyConfig


  • @Target(TYPE)
    @Retention(CLASS)
    public @interface PackageEpoxyConfig
    Use 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 Detail

      • REQUIRE_HASHCODE_DEFAULT

        static final boolean REQUIRE_HASHCODE_DEFAULT
      • REQUIRE_ABSTRACT_MODELS_DEFAULT

        static final boolean REQUIRE_ABSTRACT_MODELS_DEFAULT
      • IMPLICITLY_ADD_AUTO_MODELS_DEFAULT

        static final boolean IMPLICITLY_ADD_AUTO_MODELS_DEFAULT
    • Element Detail

      • requireHashCode

        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.

        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 contains 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.

        Default:
        false
      • implicitlyAddAutoModels

        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". 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