When creating new annotation
public @interface Invariant {
String min();
String max();
String Default();
String freeform();
}
Elements appear in what seems to be alphabetical order. I wonder if there is a way to force the same order as established in the annotation itself?
I get
@Invariant(Default = "", freeform = "", max = "", min = "")
I’d like to get
@Invariant(min = "", max = "", Default = "", freeform = "")
The order of the elements in an annotation is irrelevant, it makes no sense at all to force an ordering. Don’t waste your efforts on this, it’s not worth it – and anyway, you can’t force an ordering, it’s just not possible.