I have a class where every method starts the same way:
class Foo {
public void bar() {
if (!fooIsEnabled) return;
//...
}
public void baz() {
if (!fooIsEnabled) return;
//...
}
public void bat() {
if (!fooIsEnabled) return;
//...
}
}
Is there a nice way to require (and hopefully not write each time) the fooIsEnabled
part for every public method in the class?
Aucun commentaire:
Enregistrer un commentaire