I have an annotation I can't change which expects two String arguments.

I'd like to use it like this:

@RequestMapping( MyUrls.FOO.a, MyUrls.FOO.b )

This is how I imagined implementing it

public enum MyUrls {
    FOO("a", "b"), 
    BAR("c", "d");

    public String a, b;
    MyUrls(String a, String b) {
        this.a = a;
        this.b = b;
    }
}

This doesn't work since a or b can't be statically resolved.

What alternatives do I have which are nicer than:

class MyUrls {
    public static String FOO_A = "";
    public static String FOO_B = "";
    // ...
}
Edit
Report