org.jetbrains.kotlin.lombok.processor.SyntheticParts.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-lombok Show documentation
Show all versions of kotlin-lombok Show documentation
Kotlin lombok compiler plugin
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.lombok.processor
import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor
import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor
class SyntheticParts(
val methods: List = emptyList(),
val staticFunctions: List = emptyList(),
val constructors: List = emptyList()
) {
operator fun plus(other: SyntheticParts): SyntheticParts = SyntheticParts(
methods + other.methods,
staticFunctions + other.staticFunctions,
constructors + other.constructors
)
companion object {
val Empty = SyntheticParts()
}
}
class SyntheticPartsBuilder {
private val methods = mutableListOf()
private val staticFunctions = mutableListOf()
private val constructors = mutableListOf()
fun addMethod(method: SimpleFunctionDescriptor) {
methods += method
}
fun addStaticFunction(function: SimpleFunctionDescriptor) {
staticFunctions += function
}
fun addConstructor(constructor: ClassConstructorDescriptor) {
constructors += constructor
}
fun build(): SyntheticParts = SyntheticParts(methods, staticFunctions, constructors)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy