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
Turns '!o.isEmpty()' into 'o.isPresent()'
- Author:
- Benoit Lacelle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetIds()
boolean
isDraft()
Draft mutators are excluded by default fromCompositeMutator
.protected boolean
processNotRecursively
(com.github.javaparser.ast.Node node) Methods inherited from class eu.solven.cleanthat.engine.java.refactorer.AJavaParserMutator
getThreadJavaParser, onMethodName, optResolvedType, replaceNode, scopeHasRequiredType, scopeHasRequiredType, tryReplace, walkNode
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.solven.cleanthat.engine.java.refactorer.meta.IMutator
getId, isJreOnly, walkNode
Methods inherited from interface eu.solven.cleanthat.engine.java.refactorer.meta.IRuleExternalReferences
checkstyleUrl, getCheckstyleId, getCleanthatId, getPmdId, getSonarId, jsparrowUrl, pmdUrl, sonarUrl
-
Constructor Details
-
OptionalNotEmpty
public OptionalNotEmpty()
-
-
Method Details
-
minimalJavaVersion
- Specified by:
minimalJavaVersion
in interfaceIMutator
- 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 fromCompositeMutator
. They may be included to check theIMutator
behavior on the author code, until being considered production-grade for all users. -
getIds
-
processNotRecursively
protected boolean processNotRecursively(com.github.javaparser.ast.Node node) - Overrides:
processNotRecursively
in classAJavaParserMutator
-