Mark ensure* as private
This commit is contained in:
parent
aa0209d7de
commit
c227e496c3
|
@ -8,12 +8,12 @@ class ClassGenerator(`package`: String, val name: String, val indent: String = "
|
||||||
private val implements: MutableList<String> = ArrayList()
|
private val implements: MutableList<String> = ArrayList()
|
||||||
private var hadImport = false
|
private var hadImport = false
|
||||||
|
|
||||||
fun <T> ensureHeader(action: () -> T): T = ensureMutable {
|
private fun <T> ensureHeader(action: () -> T): T = ensureMutable {
|
||||||
if (headerGenerated) throw IllegalAccessException("Attempted to generate pre-header statement while in body")
|
if (headerGenerated) throw IllegalAccessException("Attempted to generate pre-header statement while in body")
|
||||||
action()
|
action()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun <T> ensureBody(action: () -> T): T = ensureMutable {
|
private fun <T> ensureBody(action: () -> T): T = ensureMutable {
|
||||||
if (!headerGenerated) {
|
if (!headerGenerated) {
|
||||||
headerGenerated = true
|
headerGenerated = true
|
||||||
if (hadImport) gen.appendLine()
|
if (hadImport) gen.appendLine()
|
||||||
|
|
Loading…
Reference in New Issue