Enum枚举替代方案
public static final String OFF_LINE = "OFF_LINE";
public static final String TEST = "TEST";
public static final String EMULATION = "EMULATION";
public static final String ON_LINE = "ON_LINE";
@StringDef({OFF_LINE, TEST,EMULATION,ON_LINE})
@Retention(RetentionPolicy.SOURCE)
public @interface Apis {}
@Apis String apis = OFF_LINE;
public void ms (@Apis String s){
switch (s){
case OFF_LINE:
break;
case TEST:
break;
case EMULATION:
break;
case ON_LINE:
break;
}
}