public boolean equals(Object obj) {
   if (obj == null) {
     return (false);
   } else if (obj instanceof CFBamSecurityScopeBuff) {
     CFBamSecurityScopeBuff rhs = (CFBamSecurityScopeBuff) obj;
     if (getRequiredId() != rhs.getRequiredId()) {
       return (false);
     }
     if (!getRequiredName().equals(rhs.getRequiredName())) {
       return (false);
     }
     return (true);
   } else if (obj instanceof CFBamSecurityScopePKey) {
     CFBamSecurityScopePKey rhs = (CFBamSecurityScopePKey) obj;
     if (getRequiredId() != rhs.getRequiredId()) {
       return (false);
     }
     return (true);
   } else if (obj instanceof CFBamSecurityScopeHBuff) {
     CFBamSecurityScopeHBuff rhs = (CFBamSecurityScopeHBuff) obj;
     if (getRequiredId() != rhs.getRequiredId()) {
       return (false);
     }
     if (!getRequiredName().equals(rhs.getRequiredName())) {
       return (false);
     }
     return (true);
   } else if (obj instanceof CFBamSecurityScopeHPKey) {
     CFBamSecurityScopeHPKey rhs = (CFBamSecurityScopeHPKey) obj;
     if (getRequiredId() != rhs.getRequiredId()) {
       return (false);
     }
     return (true);
   } else if (obj instanceof CFBamSecurityScopeByUNameIdxKey) {
     CFBamSecurityScopeByUNameIdxKey rhs = (CFBamSecurityScopeByUNameIdxKey) obj;
     if (!getRequiredName().equals(rhs.getRequiredName())) {
       return (false);
     }
     return (true);
   } else {
     boolean retval = super.equals(obj);
     return (retval);
   }
 }
 public void setSecurityScopeBuff(CFBamSecurityScopeBuff src) {
   setRequiredId(src.getRequiredId());
   setRequiredName(src.getRequiredName());
   setRequiredRevision(src.getRequiredRevision());
 }
  public int compareTo(Object obj) {
    if (obj == null) {
      return (-1);
    } else if (obj instanceof CFBamSecurityScopeBuff) {
      CFBamSecurityScopeBuff rhs = (CFBamSecurityScopeBuff) 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 CFBamSecurityScopePKey) {
      CFBamSecurityScopePKey rhs = (CFBamSecurityScopePKey) obj;
      if (getRequiredId() < rhs.getRequiredId()) {
        return (-1);
      } else if (getRequiredId() > rhs.getRequiredId()) {
        return (1);
      }
      return (0);
    } else if (obj instanceof CFBamSecurityScopeHPKey) {
      CFBamSecurityScopeHPKey rhs = (CFBamSecurityScopeHPKey) obj;
      {
        int lhsRequiredRevision = getRequiredRevision();
        int rhsRequiredRevision = rhs.getRequiredRevision();
        if (lhsRequiredRevision < rhsRequiredRevision) {
          return (-1);
        } else if (lhsRequiredRevision > rhsRequiredRevision) {
          return (1);
        }
      }
      if (getRequiredId() < rhs.getRequiredId()) {
        return (-1);
      } else if (getRequiredId() > rhs.getRequiredId()) {
        return (1);
      }
      return (0);
    } else if (obj instanceof CFBamSecurityScopeHBuff) {
      CFBamSecurityScopeHBuff rhs = (CFBamSecurityScopeHBuff) 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 CFBamSecurityScopeByUNameIdxKey) {
      CFBamSecurityScopeByUNameIdxKey rhs = (CFBamSecurityScopeByUNameIdxKey) obj;

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