class AuthToLocalBuilder implements Cloneable {

  public AuthToLocalBuilder addRule(String principal, String localUsername) {
    if (!StringUtils.isEmpty(principal) && !StringUtils.isEmpty(localUsername)) {
      Principal p = new Principal(principal);
      if (p.getRealm() == null) {
        throw new IllegalArgumentException(
            "Attempted to add a rule for a principal with no realm: " + principal);
      }

      Rule rule = createHostAgnosticRule(p, localUsername);
      setRules.add(rule);
    }
    return this;
  }

  public  AuthToLocalBuilder(String defaultRealm, String additionalRealms, boolean caseInsensitiveUserSupport);
  public  AuthToLocalBuilder(String defaultRealm, Collection<String> additionalRealms, boolean caseInsensitiveUserSupport);

}