Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example create enum in android annotation
//Example
User user = new User();
user.age = Numbers.ONE;
@IntDef({Numbers.ONE, Numbers.TWO, Numbers.THREE, Numbers.FOUR})
@Retention(RetentionPolicy.SOURCE)
@interface Numbers {
int ONE = 1;
int TWO = 2;
int THREE = 3;
int FOUR = 4;
}
enum NumbersWithoutAnnotation {
ONE, TWO, THREE, FOUR;
}
class User {
@Numbers
int age;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.