Skip to content

Instantly share code, notes, and snippets.

@benjishults
Created December 31, 2018 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjishults/78ab1366bba26fc2c425fe19398efc75 to your computer and use it in GitHub Desktop.
Save benjishults/78ab1366bba26fc2c425fe19398efc75 to your computer and use it in GitHub Desktop.
Processor second pass in enum refactor demo
public class Processor {
public void processFile(Path file) {
switch (DocumentType.forPath(file)) {
case TXT:
processTextFile(file);
break;
case MD:
processMarkdownFile(file);
break;
case HTML:
processHtmlFile(file);
break;
}
}
// ... the rest is as before ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment