@Override
    public boolean equals(Object o) {
      if (this == o) return true;
      if (o == null || getClass() != o.getClass()) return false;
      Rule rule = (Rule) o;
      return new EqualsBuilder()
        .append(matchingRule, rule.matchingRule)
        .append(principal, rule.principal)
        .append(substitution, rule.substitution)
        .isEquals();
    }
@param rule in the following format RULE:[n:string](regexp)s/pattern/replacement/[modifier]/[L]
ambari-server/src/main/java/org/apache/ambari/server/controller/AuthToLocalBuilder.java