/*
 * Copyright 2017, TeamDev Ltd. All rights reserved.
 *
 * Redistribution and use in source and/or binary forms, with or without
 * modification, must retain the above copyright notice and the following
 * disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package org.spine3.tools.codestyle;

/**
 * A bearable (non-negative) threshold of code style violations.
 *
 * <p>If a code style violations amount not exceed a threshold value,
 * then a code style verification is considered passed:
 * <ul>
 * <li>violations should not be reported;</li>
 * <li>if report type is {@linkplain ReportType#ERROR error}, build should not be failed.</li>
 * </ul>that violations should not be reported
 *
 * @author Dmytro Grankin
 * @see ReportType
 */
public class Threshold {

    private final int value;

    /**
     * Creates a new instance.
     *
     * @param value the non-negative value
     */
    Threshold(int value) {
        this.value = Math.max(value, 0);
    }

    public int getValue() {
        return value;
    }

    @Override
    public String toString() {
        return String.valueOf(value);
    }
}

@@ -1251,24 +1251,28 @@
 :%0A * %3Cul%3E%0A *
+    
  %3Cli%3Eviolati
@@ -1306,16 +1306,20 @@
 %3C/li%3E%0A *
+    
  %3Cli%3Eif 
@@ -1509,16 +1509,22 @@
 %0Apublic 
+final 
 class Th
@@ -1572,16 +1572,16 @@
     /**%0A
-
      * C
@@ -1610,16 +1610,87 @@
 %0A     *%0A
+     * %3Cp%3EIf the specified value is negative, zero will be set.%0A     *%0A
      * @

Mark `Threshold` final. Fix Javadoc