Created
January 27, 2012 10:09
-
-
Save mathieuancelin/1688118 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Configuration { | |
public boolean loggingEnabled = false; | |
public boolean someOptimizationEnabled = false; | |
public boolean someStuffEnabled = false; | |
} | |
@Inject Event<Configuration> configEvt; | |
public void customConfiguration() { | |
Configuration config = new Configuration(); | |
configEvent.fire(configuration); | |
if (configuration.logginEnabled) { /** Do stuff **/ } | |
if (configuration.someOptimizationEnabled) { /** Do stuff **/ } | |
if (configuration.someStuffEnabled) { /** Do stuff **/ } | |
} | |
public void configure(@Observes Configuration configuration) { | |
configuration.logginEnabled = true; | |
configuration.someStuffEnabled = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment