public boolean update(Long ruleID,Long eventID,String ruleName,String ruleDesc,Boolean enabled,Boolean notification){
  SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  String insertTime=dateFormat.format(new Timestamp(System.currentTimeMillis()));
  if (ruleID == null) {
    throw new IllegalArgumentException("primary key null.");
  }
  ContentValues args=new ContentValues();
  if (eventID != null) {
    args.put(KEY_EVENTID,eventID);
  }
  if (ruleName != null) {
    args.put(KEY_RULENAME,ruleName);
  }
  if (ruleDesc != null) {
    args.put(KEY_RULEDESC,ruleDesc);
  }
  if (enabled != null) {
    args.put(KEY_ENABLED,enabled);
  }
  if (notification != null) {
    args.put(KEY_NOTIFICATION,notification);
  }
  if (args.size() > 0) {
    args.put(KEY_UPDATED,insertTime);
    return database.update(DATABASE_TABLE,args,KEY_RULEID + "=" + ruleID,null) > 0;
  }
  return false;
}

public boolean update ( Long ruleID , Long eventID , String ruleName , String ruleDesc , Boolean enabled , Boolean notification ) { SimpleDateFormat dateFormat = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; String insertTime = dateFormat . format ( new Timestamp ( System . currentTimeMillis ( ) ) ) ; if ( ruleID == null ) { throw new IllegalArgumentException ( "primary key null." ) ; } ContentValues args = new ContentValues ( ) ; if ( eventID != null ) { args . put ( KEY_EVENTID , eventID ) ; } if ( ruleName != null ) { args . put ( KEY_RULENAME , ruleName ) ; } if ( ruleDesc != null ) { args . put ( KEY_RULEDESC , ruleDesc ) ; } if ( enabled != null ) { args . put ( KEY_ENABLED , enabled ) ; } if ( notification != null ) { args . put ( KEY_NOTIFICATION , notification ) ; } if ( args . size ( ) > 0 ) { args . put ( KEY_UPDATED , insertTime ) ; return database . update ( DATABASE_TABLE , args , KEY_RULEID + "=" + ruleID , null ) > 0 ; } return false ; }
update a rule record with specific parameters .
