public static int checkAsyncBackupCount ( int currentBackupCount , int newAsyncBackupCount ) { if ( currentBackupCount < 0 ) { throw new IllegalArgumentException ( "backup-count can't be smaller than 0" ) ; } if ( newAsyncBackupCount < 0 ) { throw new IllegalArgumentException ( "async-backup-count can't be smaller than 0" ) ; } if ( newAsyncBackupCount > MAX_BACKUP_COUNT ) { throw new IllegalArgumentException ( "async-backup-count can't be larger than than " + MAX_BACKUP_COUNT ) ; } if ( currentBackupCount + newAsyncBackupCount > MAX_BACKUP_COUNT ) { throw new IllegalArgumentException ( "the sum of backup-count and async-backup-count can't be larger than than " + MAX_BACKUP_COUNT ) ; } return newAsyncBackupCount ; }
Tests if the newAsyncBackupCount count is valid .