Change switch to if

Java switch statements only accept integer values, and the build fails because the Java compiler terminates the build because of this error. Switching to an if/else statement would fix the building failure.