[Solved] Is there a shorter way to write this code, without repeating three times switch?


I found the answer to my question.

Field field = this.getClass().getDeclaredField(nameOfField);
return (Double) field.get(this);

solved Is there a shorter way to write this code, without repeating three times switch?