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.
Merge pull request #1 from xenLiam/patch-1

Change switch to if