protected int calculateHashCode(FeatureUser user, Feature feature) {

    Validate.notNull(user, "user is required");

    return new StringBuilder()
        .append(user.getName().toLowerCase(Locale.ENGLISH).trim())
        .append(":")
        .append(feature != null ? feature.name() : "")
        .toString()
        .hashCode();
  }
Esempio n. 2
0
 public TestFeatureManager disable(Feature feature) {
   activeFeatures.remove(feature.name());
   return this;
 }
Esempio n. 3
0
 public TestFeatureManager enable(Feature feature) {
   activeFeatures.add(feature.name());
   return this;
 }
Esempio n. 4
0
 @Override
 public boolean isActive(Feature feature) {
   return activeFeatures.contains(feature.name());
 }