Code example for InvalidParameterException

0
 
        int getByteCount() { 
            return byteCount;
        } 
 
        int getFileCount() { 
            return fileCount;
        } 
 
        void setByteCount(int n) {
            if (n < 0) {
                throw new InvalidParameterException("Cache byte-count limit must be >= 0");
            } 
            byteCount = n;
        } 
 
        void setFileCount(int n) {
            if (n < 0) {
                throw new InvalidParameterException("Cache file count limit must be >= 0");
            } 
            fileCount = n;