com.github.jknack.mwa.ModeCallback Maven / Gradle / Ivy
package com.github.jknack.mwa;
/**
* A callback for executing actions in one specific {@link Mode}. Due that
* dev
is special, this interface has a custom callback method for
* running in dev.
*
* Clients of this interface can provide methods: like
* on + modeName
*
* Example if application.mode=prod
the onProd
method
* will be executed. Or if the onProd
is not present, the
* {@link #on(Mode)} method will be executed.
*
* @author edgar.espina
* @param The callback result.
*/
public abstract class ModeCallback {
/**
* Call it if application's mode is set to dev
.
*
* @return A callback result.
*/
public abstract T onDev();
/**
* Call it if application's mode is NOT dev
.
*
* @param mode The application's mode.
* @return A callback result.
*/
public abstract T on(Mode mode);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy