I do have a enum class in java as follows
public enum SMethod {
/**
* LEAVE IN THIS ORDER
*/
A (true, true, true,false),
B (true, true, false,false),
C (true, true, false,false),
D (false, false, false)
}
Another class have below method
private String getSMethod(boolean isSds) {
if (isClsSds)
return "A";
else
return "B";
}
Currently this method return hard code value but string.But I want to return it using SMethod enum.I have written it as follows:
private SMethod getSMethod(boolean isSds) {
if (isClsSds)
return SMethod.A;
else
return SMethod.B;
}
but my need is this method should return String.