• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mybatis / generator / 2106

19 Mar 2026 06:35PM UTC coverage: 90.14% (-0.05%) from 90.187%
2106

Pull #1473

github

web-flow
Merge 0a636b9e0 into ef3a2bb64
Pull Request #1473: Generate More Idiomatic Kotlin Code

2404 of 3181 branches covered (75.57%)

124 of 127 new or added lines in 32 files covered. (97.64%)

10 existing lines in 4 files now uncovered.

11802 of 13093 relevant lines covered (90.14%)

0.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

77.78
/core/mybatis-generator-core/src/main/java/org/mybatis/generator/api/dom/OutputUtilities.java
1
/*
2
 *    Copyright 2006-2026 the original author or authors.
3
 *
4
 *    Licensed under the Apache License, Version 2.0 (the "License");
5
 *    you may not use this file except in compliance with the License.
6
 *    You may obtain a copy of the License at
7
 *
8
 *       https://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *    Unless required by applicable law or agreed to in writing, software
11
 *    distributed under the License is distributed on an "AS IS" BASIS,
12
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *    See the License for the specific language governing permissions and
14
 *    limitations under the License.
15
 */
16
package org.mybatis.generator.api.dom;
17

18
public class OutputUtilities {
19

20
    /**
21
     * Utility class - no instances allowed.
22
     */
23
    private OutputUtilities() {
24
        super();
25
    }
26

27
    /**
28
     * Utility method that indents the buffer by the default amount for Java
29
     * (four spaces per indent level).
30
     *
31
     * @param sb
32
     *            a StringBuilder to append to
33
     * @param indentLevel
34
     *            the required indent level
35
     */
36
    public static void javaIndent(StringBuilder sb, int indentLevel) {
37
        sb.append(javaIndent(indentLevel));
1✔
38
    }
1✔
39

40
    public static String javaIndent(int indentLevel) {
41
        return "    ".repeat(indentLevel); //$NON-NLS-1$
1✔
42
    }
43

44
    /**
45
     * Utility method that indents the buffer by the default amount for Kotlin
46
     * (four spaces per indent level).
47
     *
48
     * @param sb
49
     *            a StringBuilder to append to
50
     * @param indentLevel
51
     *            the required indent level
52
     */
53
    public static void kotlinIndent(StringBuilder sb, int indentLevel) {
UNCOV
54
        sb.append(kotlinIndent(indentLevel));
×
UNCOV
55
    }
×
56

57
    public static String kotlinIndent(int indentLevel) {
58
        return "    ".repeat(indentLevel); //$NON-NLS-1$
1✔
59
    }
60

61
    /**
62
     * Utility method that indents the buffer by the default amount for XML (two
63
     * spaces per indent level).
64
     *
65
     * @param sb
66
     *            a StringBuilder to append to
67
     * @param indentLevel
68
     *            the required indent level
69
     */
70
    public static void xmlIndent(StringBuilder sb, int indentLevel) {
71
        sb.append(xmlIndent(indentLevel));
1✔
72
    }
1✔
73

74
    public static String xmlIndent(int indentLevel) {
75
        return "  ".repeat(indentLevel); //$NON-NLS-1$
1✔
76
    }
77
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc