@Documented
@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface FallbackEnum
name(). If no enum constant with the provided name is declared in the annotated
enum type an assertion error will be thrown.
To leverage from FallbackEnum ADAPTER_FACTORY must be added to
your moshi instance:
Moshi moshi = new Moshi.Builder()
.add(FallbackEnum.ADAPTER_FACTORY)
.build();
| Modifier and Type | Fields and Description |
|---|---|
static com.squareup.moshi.JsonAdapter.Factory |
ADAPTER_FACTORY
Builds an adapter that can process enums annotated with
FallbackEnum. |
| Modifier and Type | Required Element and Description |
|---|---|
java.lang.String |
name |
public static final com.squareup.moshi.JsonAdapter.Factory ADAPTER_FACTORY
FallbackEnum.