Class AbstractUseSwitch

All Implemented Interfaces:
BugChecker.IfTreeMatcher, Suppressible, Serializable
Direct Known Subclasses:

public abstract class AbstractUseSwitch extends BugChecker implements BugChecker.IfTreeMatcher
Helper for refactoring from if-else chains to switches.
See Also:
  • Constructor Details

    • AbstractUseSwitch

      public AbstractUseSwitch()
  • Method Details

    • getExpressionForCase

      protected abstract @Nullable String getExpressionForCase(VisitorState state, com.sun.source.tree.ExpressionTree argument)
      Returns the source text that should appear in a case statement in the fix.
    • matchIf

      public Description matchIf(com.sun.source.tree.IfTree tree, VisitorState state)
      Specified by:
      matchIf in interface BugChecker.IfTreeMatcher