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();
  }
Пример #2
0
 public TestFeatureManager(Class<? extends Feature> featureEnum) {
   Validate.notNull(featureEnum, "The featureEnum argument is required");
   Validate.isTrue(
       featureEnum.isEnum(), "This feature manager currently only works with feature enums");
   this.featureEnum = featureEnum;
 }