/*
 * Copyright 2018, 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 io.spine.tools;

import com.google.common.base.Strings;
import io.spine.type.StringTypeValue;

/**
 * A positive space-based indentation of generated code.
 *
 * @author Illia Shepilov
 * @author Alexander Yevsyukov
 */
public final class Indent extends StringTypeValue {

    private static final String SPACE = " ";
    private static final Indent TWO = new Indent(2);
    private static final Indent FOUR = new Indent(4);

    private final int size;

    private Indent(int indent) {
        super(Strings.repeat(SPACE, indent));
        this.size = indent;
    }

    /**
     * Creates an instance for non-negative indent.
     */
    public static Indent of(int indent) {
        if (indent == 4) {
            return of4();
        }
        if (indent == 2) {
            return of2();
        }

        return new Indent(indent);
    }

    public static Indent of2() {
        return TWO;
    }

    public static Indent of4() {
        return FOUR;
    }

    public int getSize() {
        return size;
    }
}

@@ -1858,32 +1858,91 @@
 indent);%0A    %7D%0A%0A
+    /**%0A     * Obtains the indent with two spaces.%0A     */%0A
     public stati
@@ -1993,64 +1993,184 @@
     
-public static Indent of4() %7B%0A        return FOUR;%0A    %7D%0A
+/**%0A     * Obtains the indent with four spaces.%0A     */%0A    public static Indent of4() %7B%0A        return FOUR;%0A    %7D%0A%0A    /**%0A     * Obtains the size of the indentation.%0A     */
 %0A   

Add missing public Javadocs in `Indent`