Class OptionalNotEmpty

java.lang.Object
eu.solven.cleanthat.engine.java.refactorer.AJavaParserMutator
eu.solven.cleanthat.engine.java.refactorer.mutators.OptionalNotEmpty
All Implemented Interfaces:
IMutator, IRuleExternalReferences

public class OptionalNotEmpty extends AJavaParserMutator implements IMutator
Turns '!o.isEmpty()' into 'o.isPresent()'
Author:
Benoit Lacelle
  • Constructor Details

    • OptionalNotEmpty

      public OptionalNotEmpty()
  • Method Details

    • minimalJavaVersion

      public String minimalJavaVersion()
      Specified by:
      minimalJavaVersion in interface IMutator
      Returns:
      the minimal JDK for which this rule is applicable. For instance, any rule related with diamond operator requires JDK1.5
    • isDraft

      public boolean isDraft()
      Description copied from interface: IMutator
      Draft mutators are excluded by default from CompositeMutator. They may be included to check the IMutator behavior on the author code, until being considered production-grade for all users.
      Specified by:
      isDraft in interface IMutator
      Returns:
      true if this mutator is considered draft.
    • getIds

      public Set<String> getIds()
      Specified by:
      getIds in interface IMutator
    • processNotRecursively

      protected boolean processNotRecursively(com.github.javaparser.ast.Node node)
      Overrides:
      processNotRecursively in class AJavaParserMutator