File tree Expand file tree Collapse file tree 2 files changed +38
-2
lines changed
src/main/kotlin/com/github/jonathanxd/codeapi/bytecode/extra Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ buildscript {
1818}
1919
2020group ' com.github.jonathanxd'
21- version ' 3.1.1-3.1.3 '
21+ version ' 3.1.1-3.1.4 '
2222
2323apply from : project(" :CodeAPI" ). file(" gradle/common.gradle" )
2424
Original file line number Diff line number Diff line change 2727 */
2828package com.github.jonathanxd.codeapi.bytecode.extra
2929
30+ import com.github.jonathanxd.codeapi.CodePart
3031import com.github.jonathanxd.codeapi.base.Typed
32+ import com.github.jonathanxd.codeapi.type.CodeType
3133
3234/* *
3335 * CodeAPI-BytecodeWriter Dup part. This part will dup result of [part].
3436 */
35- data class Dup (val part : Typed ) : Typed by part
37+ data class Dup (val part : CodePart , override val type : CodeType ) : Typed {
38+
39+ constructor (part: Typed ) : this (part, part.type)
40+
41+ override fun builder (): Builder = Builder (this )
42+
43+ class Builder () : Typed.Builder<Dup, Builder> {
44+
45+ lateinit var part: CodePart
46+ lateinit var type: CodeType
47+
48+ constructor (defaults: Dup ) : this () {
49+ this .part = defaults.part
50+ this .type = defaults.type
51+ }
52+
53+ fun withPart (value : CodePart ): Builder {
54+ this .part = value
55+ return this
56+ }
57+
58+ override fun withType (value : CodeType ): Builder {
59+ this .type = value
60+ return this
61+ }
62+
63+ override fun build (): Dup = Dup (this .part, this .type)
64+
65+ companion object {
66+ @JvmStatic
67+ fun builder () = Builder ()
68+ }
69+ }
70+
71+ }
You can’t perform that action at this time.
0 commit comments