/*
 * 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;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * A configuration class for the {@link CodestyleCheckerPlugin} nested plugins.
 *
 * @author Dmytro Grankin
 */
public class StepConfiguration {

    private Threshold threshold = new Threshold(0);
    private ReportType reportType = ReportType.WARN;

    public ReportType getReportType() {
        return reportType;
    }

    public Threshold getThreshold() {
        return threshold;
    }

    public void setThreshold(int value) {
        this.threshold = new Threshold(value);
        log().debug("Threshold set up to {}", threshold);
    }

    public void setReportType(String reportType) {
        this.reportType = ReportType.of(reportType);
        log().debug("Report type set up to {}", this.reportType);
    }

    private static Logger log() {
        return LoggerSingleton.INSTANCE.logger;
    }

    private enum LoggerSingleton {
        INSTANCE;
        @SuppressWarnings("NonSerializableFieldInSerializableClass")
        private final Logger logger = LoggerFactory.getLogger(StepConfiguration.class);
    }
}

@@ -1104,16 +1104,82 @@
 ctory;%0A%0A
+import static com.google.common.base.Preconditions.checkNotNull;%0A%0A
 /**%0A * A
@@ -1294,16 +1294,22 @@
 %0Apublic 
+final 
 class St
@@ -1335,55 +1335,259 @@
     
-private Threshold threshold = new Threshold(0);
+/**%0A     * A bearable threshold of code style violations.%0A     *%0A     * Zero is default.%0A     */%0A    private Threshold threshold = new Threshold(0);%0A%0A    /**%0A     * A plugin %7B@link ReportType%7D.%0A     *%0A     * %7B@link ReportType#WARN%7D is default.%0A     */
 %0A   
@@ -1983,24 +1983,58 @@
 portType) %7B%0A
+        checkNotNull(reportType);%0A
         this

Improve `StepConfiguration` code