public boolean equals(Object obj) {
   if (obj == null) {
     return (false);
   } else if (obj instanceof CFGenKbRuleTypeBuff) {
     CFGenKbRuleTypeBuff rhs = (CFGenKbRuleTypeBuff) obj;
     if (getRequiredId() != rhs.getRequiredId()) {
       return (false);
     }
     if (!getRequiredName().equals(rhs.getRequiredName())) {
       return (false);
     }
     return (true);
   } else if (obj instanceof CFGenKbRuleTypePKey) {
     CFGenKbRuleTypePKey rhs = (CFGenKbRuleTypePKey) obj;
     if (getRequiredId() != rhs.getRequiredId()) {
       return (false);
     }
     return (true);
   } else if (obj instanceof CFGenKbRuleTypeByNameIdxKey) {
     CFGenKbRuleTypeByNameIdxKey rhs = (CFGenKbRuleTypeByNameIdxKey) obj;
     if (!getRequiredName().equals(rhs.getRequiredName())) {
       return (false);
     }
     return (true);
   } else {
     boolean retval = super.equals(obj);
     return (retval);
   }
 }
  public int compareTo(Object obj) {
    if (obj == null) {
      return (-1);
    } else if (obj instanceof CFGenKbRuleTypeBuff) {
      CFGenKbRuleTypeBuff rhs = (CFGenKbRuleTypeBuff) obj;
      int retval = 0;
      if (getRequiredId() < rhs.getRequiredId()) {
        return (-1);
      } else if (getRequiredId() > rhs.getRequiredId()) {
        return (1);
      }
      {
        int cmp = getRequiredName().compareTo(rhs.getRequiredName());
        if (cmp != 0) {
          return (cmp);
        }
      }
      return (0);
    } else if (obj instanceof CFGenKbRuleTypePKey) {
      CFGenKbRuleTypePKey rhs = (CFGenKbRuleTypePKey) obj;
      if (getRequiredId() < rhs.getRequiredId()) {
        return (-1);
      } else if (getRequiredId() > rhs.getRequiredId()) {
        return (1);
      }
      return (0);
    } else if (obj instanceof CFGenKbRuleTypeByNameIdxKey) {
      CFGenKbRuleTypeByNameIdxKey rhs = (CFGenKbRuleTypeByNameIdxKey) obj;

      {
        int cmp = getRequiredName().compareTo(rhs.getRequiredName());
        if (cmp != 0) {
          return (cmp);
        }
      }
      return (0);
    } else {
      throw CFLib.getDefaultExceptionFactory()
          .newUnsupportedClassException(getClass(), "compareTo", "obj", obj, null);
    }
  }