Reputation: 13031
i have the following code:
public static final String MY_CONSTANT_A = "A";
public static final String MY_CONSTANT_B = "B";
@StringDef(value={
MY_CONSTANT_A,
MY_CONSTANT_B
})
private @interface MyAnnotation{}
public static void someFunc(@MyAnnotation String str){
}
now when im trying to use string inside someFunc i got the next lint error as excepted:
now when i change my function to String ... str im not getting this lint error anymore.
public static void someFunc(@MyAnnotation String... str){
}
what is the way to do this?
Upvotes: 1
Views: 904
Reputation: 17851
As far as I know, there is no Support annotation
for Varargs and neither does StringDef
does this. StringDef
is just for String
data type and does not extend to Varargs, yet.
The documentation has nothing on supporting Varargs: http://developer.android.com/reference/android/support/annotation/StringDef.html
Upvotes: 1