<commit_before>/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.commons.pool2.impl;

/**
 * 
 * @version $Revision$ $Date$
 * @since Pool 2.0
 */
public class StackObjectPoolConfig {

    /**
     * The cap on the number of "sleeping" instances in the pool.
     */
    public static final int DEFAULT_MAX_SLEEPING  = 8;

    /**
     * The default initial size of the pool
     * (this specifies the size of the container, it does not
     * cause the pool to be pre-populated.)
     */
    public static final int DEFAULT_INIT_SLEEPING_CAPACITY = 4;

    /**
     * cap on the number of "sleeping" instances in the pool
     */
    private final int maxSleeping;

    /**
     * initial size of the pool (this specifies the size of the container,
     * it does not cause the pool to be pre-populated.)
     */
    private final int initIdleCapacity;

    public StackObjectPoolConfig(final int maxSleeping, final int initIdleCapacity) {
        this.maxSleeping = (maxSleeping < 0 ? DEFAULT_MAX_SLEEPING : maxSleeping);
        this.initIdleCapacity = (initIdleCapacity < 1 ? DEFAULT_INIT_SLEEPING_CAPACITY : initIdleCapacity);
    }

    public int getMaxSleeping() {
        return maxSleeping;
    }

    public int getInitIdleCapacity() {
        return initIdleCapacity;
    }

    /**
     * Helper class to easily build {@link StackObjectPoolConfig} instances.
     */
    public static final class Builder {
<commit_msg>added documentation that parameters are reset if out of range<commit_after>/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.commons.pool2.impl;

/**
 * 
 * @version $Revision$ $Date$
 * @since Pool 2.0
 */
public class StackObjectPoolConfig {

    /**
     * The cap on the number of "sleeping" instances in the pool.
     */
    public static final int DEFAULT_MAX_SLEEPING  = 8;

    /**
     * The default initial size of the pool
     * (this specifies the size of the container, it does not
     * cause the pool to be pre-populated.)
     */
    public static final int DEFAULT_INIT_SLEEPING_CAPACITY = 4;

    /**
     * cap on the number of "sleeping" instances in the pool
     */
    private final int maxSleeping;

    /**
     * initial size of the pool (this specifies the size of the container,
     * it does not cause the pool to be pre-populated.)
     */
    private final int initIdleCapacity;

    /**
     * Creates a new StackObjectPoolConfig instance, resetting the parameters
     * if they are out of range.
     *
     * If maxSleeping parameter is less than 0, the configuration instance takes
     * the {@link #DEFAULT_MAX_SLEEPING} value.
     *
     * If initIdleCapacity parameter is less than 1, the configuration instance takes
     * the {@link #DEFAULT_INIT_SLEEPING_CAPACITY} value.
     *
     * @param maxSleeping
     * @param initIdleCapacity
     */
    public StackObjectPoolConfig(final int maxSleeping, final int initIdleCapacity) {
        this.maxSleeping = (maxSleeping < 0 ? DEFAULT_MAX_SLEEPING : maxSleeping);
        this.initIdleCapacity = (initIdleCapacity < 1 ? DEFAULT_INIT_SLEEPING_CAPACITY : initIdleCapacity);
    }

    public int getMaxSleeping() {
        return maxSleeping;
    }

    public int getInitIdleCapacity() {
        return initIdleCapacity;
    }

    /**
     * Helper class to easily build {@link StackObjectPoolConfig} instances.
     */
    public static final class Builder {

{'fraction_non_alphanumeric': 0.0713417105796514, 'fraction_numerical': 0.004864207539521687, 'mean_word_length': 3.018729641693811, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7059402', 'n_tokens_mistral': 1365, 'n_tokens_neox': 1310, 'n_words': 555}