Resolves checkstyle errors for feature-toggle fluentinterface flux flyweight front-controller (#1078)
* Reduces checkstyle errors in feature-toggle * Reduces checkstyle errors in fluentinterface * Reduces checkstyle errors in flux * Reduces checkstyle errors in flyweight * Reduces checkstyle errors in front-controller
This commit is contained in:
committed by
Ilkka Seppälä
parent
c954a436ad
commit
37599eb48f
@@ -26,10 +26,11 @@ package com.iluwatar.featuretoggle.pattern;
|
||||
import com.iluwatar.featuretoggle.user.User;
|
||||
|
||||
/**
|
||||
* 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}.
|
||||
* 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
|
||||
|
@@ -25,16 +25,16 @@ package com.iluwatar.featuretoggle.pattern.propertiesversion;
|
||||
|
||||
import com.iluwatar.featuretoggle.pattern.Service;
|
||||
import com.iluwatar.featuretoggle.user.User;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* This example of the Feature Toogle pattern is less dynamic version than
|
||||
* {@link com.iluwatar.featuretoggle.pattern.tieredversion.TieredFeatureToggleVersion} where the feature is turned on
|
||||
* or off at the time of creation of the service. This example uses simple Java {@link Properties} however it could as
|
||||
* easily be done with an external configuration file loaded by Spring and so on. A good example of when to use this
|
||||
* version of the feature toggle is when new features are being developed. So you could have a configuration property
|
||||
* boolean named development or some sort of system environment variable.
|
||||
* This example of the Feature Toogle pattern is less dynamic version than {@link
|
||||
* com.iluwatar.featuretoggle.pattern.tieredversion.TieredFeatureToggleVersion} where the feature is
|
||||
* turned on or off at the time of creation of the service. This example uses simple Java {@link
|
||||
* Properties} however it could as easily be done with an external configuration file loaded by
|
||||
* Spring and so on. A good example of when to use this version of the feature toggle is when new
|
||||
* features are being developed. So you could have a configuration property boolean named
|
||||
* development or some sort of system environment variable.
|
||||
*
|
||||
* @see Service
|
||||
* @see com.iluwatar.featuretoggle.pattern.tieredversion.TieredFeatureToggleVersion
|
||||
@@ -45,9 +45,10 @@ public class PropertiesFeatureToggleVersion implements Service {
|
||||
private boolean isEnhanced;
|
||||
|
||||
/**
|
||||
* Creates an instance of {@link PropertiesFeatureToggleVersion} using the passed {@link Properties} to determine,
|
||||
* the status of the feature toggle {@link PropertiesFeatureToggleVersion#isEnhanced()}. There is also some defensive
|
||||
* code to ensure the {@link Properties} passed are as expected.
|
||||
* Creates an instance of {@link PropertiesFeatureToggleVersion} using the passed {@link
|
||||
* Properties} to determine, the status of the feature toggle {@link
|
||||
* PropertiesFeatureToggleVersion#isEnhanced()}. There is also some defensive code to ensure the
|
||||
* {@link Properties} passed are as expected.
|
||||
*
|
||||
* @param properties {@link Properties} used to configure the service and toggle features.
|
||||
* @throws IllegalArgumentException when the passed {@link Properties} is not as expected
|
||||
@@ -66,14 +67,14 @@ public class PropertiesFeatureToggleVersion implements Service {
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a welcome message based on the user being passed and the status of the feature toggle. If the enhanced
|
||||
* version is enabled, then the message will be personalised with the name of the passed {@link User}. However if
|
||||
* disabled then a generic version fo the message is returned.
|
||||
* Generate a welcome message based on the user being passed and the status of the feature toggle.
|
||||
* If the enhanced version is enabled, then the message will be personalised with the name of the
|
||||
* passed {@link User}. However if disabled then a generic version fo the message is returned.
|
||||
*
|
||||
* @param user the {@link User} to be displayed in the message if the enhanced version is enabled see
|
||||
* {@link PropertiesFeatureToggleVersion#isEnhanced()}. If the enhanced version is enabled, then the
|
||||
* message will be personalised with the name of the passed {@link User}. However if disabled then a
|
||||
* generic version fo the message is returned.
|
||||
* @param user the {@link User} to be displayed in the message if the enhanced version is enabled
|
||||
* see {@link PropertiesFeatureToggleVersion#isEnhanced()}. If the enhanced version is
|
||||
* enabled, then the message will be personalised with the name of the passed {@link
|
||||
* User}. However if disabled then a generic version fo the message is returned.
|
||||
* @return Resulting welcome message.
|
||||
* @see User
|
||||
*/
|
||||
@@ -88,9 +89,9 @@ public class PropertiesFeatureToggleVersion implements Service {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method that checks if the welcome message to be returned is the enhanced venison or not. For this service it will
|
||||
* see the value of the boolean that was set in the constructor
|
||||
* {@link PropertiesFeatureToggleVersion#PropertiesFeatureToggleVersion(Properties)}
|
||||
* Method that checks if the welcome message to be returned is the enhanced venison or not. For
|
||||
* this service it will see the value of the boolean that was set in the constructor {@link
|
||||
* PropertiesFeatureToggleVersion#PropertiesFeatureToggleVersion(Properties)}
|
||||
*
|
||||
* @return Boolean value {@code true} if enhanced.
|
||||
*/
|
||||
|
@@ -28,11 +28,12 @@ import com.iluwatar.featuretoggle.user.User;
|
||||
import com.iluwatar.featuretoggle.user.UserGroup;
|
||||
|
||||
/**
|
||||
* This example of the Feature Toogle pattern shows how it could be implemented based on a {@link User}. Therefore
|
||||
* showing its use within a tiered application where the paying users get access to different content or
|
||||
* better versions of features. So in this instance a {@link User} is passed in and if they are found to be
|
||||
* on the {@link UserGroup#isPaid(User)} they are welcomed with a personalised message. While the other is more
|
||||
* generic. However this pattern is limited to simple examples such as the one below.
|
||||
* This example of the Feature Toogle pattern shows how it could be implemented based on a {@link
|
||||
* User}. Therefore showing its use within a tiered application where the paying users get access to
|
||||
* different content or better versions of features. So in this instance a {@link User} is passed in
|
||||
* and if they are found to be on the {@link UserGroup#isPaid(User)} they are welcomed with a
|
||||
* personalised message. While the other is more generic. However this pattern is limited to simple
|
||||
* examples such as the one below.
|
||||
*
|
||||
* @see Service
|
||||
* @see User
|
||||
@@ -42,12 +43,13 @@ import com.iluwatar.featuretoggle.user.UserGroup;
|
||||
public class TieredFeatureToggleVersion implements Service {
|
||||
|
||||
/**
|
||||
* Generates a welcome message from the passed {@link User}. The resulting message depends on the group of the
|
||||
* {@link User}. So if the {@link User} is in the {@link UserGroup#paidGroup} then the enhanced version of the
|
||||
* welcome message will be returned where the username is displayed.
|
||||
* Generates a welcome message from the passed {@link User}. The resulting message depends on the
|
||||
* group of the {@link User}. So if the {@link User} is in the {@link UserGroup#paidGroup} then
|
||||
* the enhanced version of the welcome message will be returned where the username is displayed.
|
||||
*
|
||||
* @param user the {@link User} to generate the welcome message for, different messages are displayed if the user is
|
||||
* in the {@link UserGroup#isPaid(User)} or {@link UserGroup#freeGroup}
|
||||
* @param user the {@link User} to generate the welcome message for, different messages are
|
||||
* displayed if the user is in the {@link UserGroup#isPaid(User)} or {@link
|
||||
* UserGroup#freeGroup}
|
||||
* @return Resulting welcome message.
|
||||
* @see User
|
||||
* @see UserGroup
|
||||
@@ -62,9 +64,9 @@ public class TieredFeatureToggleVersion implements Service {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method that checks if the welcome message to be returned is the enhanced version. For this instance as the logic
|
||||
* is driven by the user group. This method is a little redundant. However can be used to show that there is an
|
||||
* enhanced version available.
|
||||
* Method that checks if the welcome message to be returned is the enhanced version. For this
|
||||
* instance as the logic is driven by the user group. This method is a little redundant. However
|
||||
* can be used to show that there is an enhanced version available.
|
||||
*
|
||||
* @return Boolean value {@code true} if enhanced.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user