2016-01-26 18:49:25 +00:00
|
|
|
package com.iluwatar.featuretoggle.pattern;
|
|
|
|
|
|
|
|
import com.iluwatar.featuretoggle.user.User;
|
|
|
|
|
2016-01-31 13:46:34 +00:00
|
|
|
/**
|
|
|
|
* Simple interfaces to allow the calling of the method to generate the welcome message for a given user. While there is
|
|
|
|
* a helper method to gather the the status of the feature toggle. In some cases there is no need for the
|
|
|
|
* {@link Service#isEnhanced()} in {@link com.iluwatar.featuretoggle.pattern.tieredversion.TieredFeatureToggleVersion}
|
|
|
|
* where the toggle is determined by the actual {@link User}.
|
|
|
|
*
|
|
|
|
* @see com.iluwatar.featuretoggle.pattern.propertiesversion.PropertiesFeatureToggleVersion
|
|
|
|
* @see com.iluwatar.featuretoggle.pattern.tieredversion.TieredFeatureToggleVersion
|
|
|
|
* @see User
|
|
|
|
*/
|
2016-01-26 18:49:25 +00:00
|
|
|
public interface Service {
|
|
|
|
|
2016-01-31 13:46:34 +00:00
|
|
|
/**
|
|
|
|
* Generates a welcome message for the passed user.
|
|
|
|
*
|
|
|
|
* @param user the {@link User} to be used if the message is to be personalised.
|
|
|
|
* @return Generated {@link String} welcome message
|
|
|
|
*/
|
2016-01-26 19:20:28 +00:00
|
|
|
String getWelcomeMessage(User user);
|
2016-01-26 18:58:35 +00:00
|
|
|
|
2016-01-31 13:46:34 +00:00
|
|
|
/**
|
|
|
|
* Returns if the welcome message to be displayed will be the enhanced version.
|
|
|
|
*
|
|
|
|
* @return Boolean {@value true} if enhanced.
|
|
|
|
*/
|
2016-01-26 21:18:47 +00:00
|
|
|
boolean isEnhanced();
|
|
|
|
|
2016-01-26 18:49:25 +00:00
|
|
|
}
|