following the comment above, this could be simpler:

````
private RESTModuleType validateAndReturnModuleType(String givenModuleType) {
    try {
        return RESTModuleType.valueOf(givenModuleType);
    }
    catch (IllegalArgumentException e) {
        logger.warning("Not a valid module type. Valid module types are: "
                + Arrays.toString(RESTModuleType.values()));
        throw new ShellException();
    }
}
````