I used to define a set of related constants like Bundle
keys together in an interface like below:
public interface From{
String LOGIN_SCREEN
I like to add, that you can not use @Annotations when you declare a List<> or Map<> where either key or value is of one of your annotation interfaces. You get the error "Annotations are not allowed here".
enum Values { One, Two, Three }
Map myMap; // This works
// ... but ...
public static final int ONE = 1;
public static final int TWO = 2;
public static final int THREE = 3;
@Retention(RetentionPolicy.SOURCE)
@IntDef({ONE, TWO, THREE})
public @interface Values {}
Map myMap; // *** ERROR ***
So when you need to pack it into a list/map, use enum, as they can be added, but @annotated int/string groups can not.