fr.vergne.pester.options.Mutability Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pester-core Show documentation
Show all versions of pester-core Show documentation
Implementation of the Pester library.
The newest version!
package fr.vergne.pester.options;
import java.lang.reflect.Modifier;
import java.util.function.Predicate;
public enum Mutability implements Option {
FINAL(Modifier::isFinal), NON_FINAL(mod -> !Modifier.isFinal(mod));
private final Predicate modifierPredicate;
private Mutability(Predicate modifierPredicate) {
this.modifierPredicate = modifierPredicate;
}
@Override
public boolean testModifiers(int modifiers) {
return modifierPredicate.test(modifiers);
}
}