I want to store a custom enum in my collection, how can I do this?
1 Comment
E
Edward
said
over 7 years ago
When defining your enum, add the @Value annotation to each possible value. Then, in your GenericJson class you can use the standard @Key annotation and use the enum as you would any other type of value.
For example:
import com.google.api.client.util.Value;
public enum COUNTER{
@Value
ONE,
@Value
TWO;
}
and then, in your GenericJson class, you can add the following:
Edward