sdkcompat/gen/org/jetbrains/bazel/sdkcompat/workspacemodel/entities/impl/PackageMarkerEntityImpl.kt [1:177]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - package org.jetbrains.bazel.sdkcompat.workspacemodel.entities.impl import com.intellij.platform.workspace.jps.entities.ModuleEntity import com.intellij.platform.workspace.storage.ConnectionId import com.intellij.platform.workspace.storage.EntitySource import com.intellij.platform.workspace.storage.EntityType import com.intellij.platform.workspace.storage.GeneratedCodeApiVersion import com.intellij.platform.workspace.storage.GeneratedCodeImplVersion import com.intellij.platform.workspace.storage.MutableEntityStorage import com.intellij.platform.workspace.storage.WorkspaceEntity import com.intellij.platform.workspace.storage.WorkspaceEntityInternalApi import com.intellij.platform.workspace.storage.annotations.Parent import com.intellij.platform.workspace.storage.impl.EntityLink import com.intellij.platform.workspace.storage.impl.ModifiableWorkspaceEntityBase import com.intellij.platform.workspace.storage.impl.WorkspaceEntityBase import com.intellij.platform.workspace.storage.impl.WorkspaceEntityData import com.intellij.platform.workspace.storage.impl.extractOneToManyParent import com.intellij.platform.workspace.storage.impl.updateOneToManyParentOfChild import com.intellij.platform.workspace.storage.instrumentation.EntityStorageInstrumentation import com.intellij.platform.workspace.storage.instrumentation.EntityStorageInstrumentationApi import com.intellij.platform.workspace.storage.instrumentation.MutableEntityStorageInstrumentation import com.intellij.platform.workspace.storage.metadata.model.EntityMetadata import com.intellij.platform.workspace.storage.url.VirtualFileUrl import org.jetbrains.bazel.sdkcompat.workspacemodel.entities.PackageMarkerEntity @GeneratedCodeApiVersion(3) @GeneratedCodeImplVersion(7) @OptIn(WorkspaceEntityInternalApi::class) internal class PackageMarkerEntityImpl(private val dataSource: PackageMarkerEntityData) : PackageMarkerEntity, WorkspaceEntityBase( dataSource) { private companion object { internal val MODULE_CONNECTION_ID: ConnectionId = ConnectionId.create(ModuleEntity::class.java, PackageMarkerEntity::class.java, ConnectionId.ConnectionType.ONE_TO_MANY, false) private val connections = listOf( MODULE_CONNECTION_ID, ) } override val root: VirtualFileUrl get() { readField("root") return dataSource.root } override val packagePrefix: String get() { readField("packagePrefix") return dataSource.packagePrefix } override val module: ModuleEntity get() = snapshot.extractOneToManyParent(MODULE_CONNECTION_ID, this)!! override val entitySource: EntitySource get() { readField("entitySource") return dataSource.entitySource } override fun connectionIdList(): List { return connections } internal class Builder(result: PackageMarkerEntityData?) : ModifiableWorkspaceEntityBase( result), PackageMarkerEntity.Builder { internal constructor() : this(PackageMarkerEntityData()) override fun applyToBuilder(builder: MutableEntityStorage) { if (this.diff != null) { if (existsInBuilder(builder)) { this.diff = builder return } else { error("Entity PackageMarkerEntity is already created in a different builder") } } this.diff = builder addToBuilder() this.id = getEntityData().createEntityId() // After adding entity data to the builder, we need to unbind it and move the control over entity data to builder // Builder may switch to snapshot at any moment and lock entity data to modification this.currentEntityData = null index(this, "root", this.root) // Process linked entities that are connected without a builder processLinkedEntities(builder) checkInitialization() // TODO uncomment and check failed tests } private fun checkInitialization() { val _diff = diff if (!getEntityData().isEntitySourceInitialized()) { error("Field WorkspaceEntity#entitySource should be initialized") } if (!getEntityData().isRootInitialized()) { error("Field PackageMarkerEntity#root should be initialized") } if (!getEntityData().isPackagePrefixInitialized()) { error("Field PackageMarkerEntity#packagePrefix should be initialized") } if (_diff != null) { if (_diff.extractOneToManyParent(MODULE_CONNECTION_ID, this) == null) { error("Field PackageMarkerEntity#module should be initialized") } } else { if (this.entityLinks[EntityLink(false, MODULE_CONNECTION_ID)] == null) { error("Field PackageMarkerEntity#module should be initialized") } } } override fun connectionIdList(): List { return connections } // Relabeling code, move information from dataSource to this builder override fun relabel(dataSource: WorkspaceEntity, parents: Set?) { dataSource as PackageMarkerEntity if (this.entitySource != dataSource.entitySource) this.entitySource = dataSource.entitySource if (this.root != dataSource.root) this.root = dataSource.root if (this.packagePrefix != dataSource.packagePrefix) this.packagePrefix = dataSource.packagePrefix updateChildToParentReferences(parents) } override var entitySource: EntitySource get() = getEntityData().entitySource set(value) { checkModificationAllowed() getEntityData(true).entitySource = value changedProperty.add("entitySource") } override var root: VirtualFileUrl get() = getEntityData().root set(value) { checkModificationAllowed() getEntityData(true).root = value changedProperty.add("root") val _diff = diff if (_diff != null) index(this, "root", value) } override var packagePrefix: String get() = getEntityData().packagePrefix set(value) { checkModificationAllowed() getEntityData(true).packagePrefix = value changedProperty.add("packagePrefix") } override var module: ModuleEntity.Builder get() { val _diff = diff return if (_diff != null) { @OptIn(EntityStorageInstrumentationApi::class) ((_diff as MutableEntityStorageInstrumentation).getParentBuilder(MODULE_CONNECTION_ID, this) as? ModuleEntity.Builder) ?: (this.entityLinks[EntityLink(false, MODULE_CONNECTION_ID)]!! as ModuleEntity.Builder) } else { this.entityLinks[EntityLink(false, MODULE_CONNECTION_ID)]!! as ModuleEntity.Builder } } set(value) { checkModificationAllowed() val _diff = diff if (_diff != null && value is ModifiableWorkspaceEntityBase<*, *> && value.diff == null) { // Setting backref of the list if (value is ModifiableWorkspaceEntityBase<*, *>) { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sdkcompat/v252/org/jetbrains/bazel/sdkcompat/workspacemodel/entities/impl/PackageMarkerEntityImpl.kt [1:177]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - package org.jetbrains.bazel.sdkcompat.workspacemodel.entities.impl import com.intellij.platform.workspace.jps.entities.ModuleEntity import com.intellij.platform.workspace.storage.ConnectionId import com.intellij.platform.workspace.storage.EntitySource import com.intellij.platform.workspace.storage.EntityType import com.intellij.platform.workspace.storage.GeneratedCodeApiVersion import com.intellij.platform.workspace.storage.GeneratedCodeImplVersion import com.intellij.platform.workspace.storage.MutableEntityStorage import com.intellij.platform.workspace.storage.WorkspaceEntity import com.intellij.platform.workspace.storage.WorkspaceEntityInternalApi import com.intellij.platform.workspace.storage.annotations.Parent import com.intellij.platform.workspace.storage.impl.EntityLink import com.intellij.platform.workspace.storage.impl.ModifiableWorkspaceEntityBase import com.intellij.platform.workspace.storage.impl.WorkspaceEntityBase import com.intellij.platform.workspace.storage.impl.WorkspaceEntityData import com.intellij.platform.workspace.storage.impl.extractOneToManyParent import com.intellij.platform.workspace.storage.impl.updateOneToManyParentOfChild import com.intellij.platform.workspace.storage.instrumentation.EntityStorageInstrumentation import com.intellij.platform.workspace.storage.instrumentation.EntityStorageInstrumentationApi import com.intellij.platform.workspace.storage.instrumentation.MutableEntityStorageInstrumentation import com.intellij.platform.workspace.storage.metadata.model.EntityMetadata import com.intellij.platform.workspace.storage.url.VirtualFileUrl import org.jetbrains.bazel.sdkcompat.workspacemodel.entities.PackageMarkerEntity @GeneratedCodeApiVersion(3) @GeneratedCodeImplVersion(7) @OptIn(WorkspaceEntityInternalApi::class) internal class PackageMarkerEntityImpl(private val dataSource: PackageMarkerEntityData) : PackageMarkerEntity, WorkspaceEntityBase( dataSource) { private companion object { internal val MODULE_CONNECTION_ID: ConnectionId = ConnectionId.create(ModuleEntity::class.java, PackageMarkerEntity::class.java, ConnectionId.ConnectionType.ONE_TO_MANY, false) private val connections = listOf( MODULE_CONNECTION_ID, ) } override val root: VirtualFileUrl get() { readField("root") return dataSource.root } override val packagePrefix: String get() { readField("packagePrefix") return dataSource.packagePrefix } override val module: ModuleEntity get() = snapshot.extractOneToManyParent(MODULE_CONNECTION_ID, this)!! override val entitySource: EntitySource get() { readField("entitySource") return dataSource.entitySource } override fun connectionIdList(): List { return connections } internal class Builder(result: PackageMarkerEntityData?) : ModifiableWorkspaceEntityBase( result), PackageMarkerEntity.Builder { internal constructor() : this(PackageMarkerEntityData()) override fun applyToBuilder(builder: MutableEntityStorage) { if (this.diff != null) { if (existsInBuilder(builder)) { this.diff = builder return } else { error("Entity PackageMarkerEntity is already created in a different builder") } } this.diff = builder addToBuilder() this.id = getEntityData().createEntityId() // After adding entity data to the builder, we need to unbind it and move the control over entity data to builder // Builder may switch to snapshot at any moment and lock entity data to modification this.currentEntityData = null index(this, "root", this.root) // Process linked entities that are connected without a builder processLinkedEntities(builder) checkInitialization() // TODO uncomment and check failed tests } private fun checkInitialization() { val _diff = diff if (!getEntityData().isEntitySourceInitialized()) { error("Field WorkspaceEntity#entitySource should be initialized") } if (!getEntityData().isRootInitialized()) { error("Field PackageMarkerEntity#root should be initialized") } if (!getEntityData().isPackagePrefixInitialized()) { error("Field PackageMarkerEntity#packagePrefix should be initialized") } if (_diff != null) { if (_diff.extractOneToManyParent(MODULE_CONNECTION_ID, this) == null) { error("Field PackageMarkerEntity#module should be initialized") } } else { if (this.entityLinks[EntityLink(false, MODULE_CONNECTION_ID)] == null) { error("Field PackageMarkerEntity#module should be initialized") } } } override fun connectionIdList(): List { return connections } // Relabeling code, move information from dataSource to this builder override fun relabel(dataSource: WorkspaceEntity, parents: Set?) { dataSource as PackageMarkerEntity if (this.entitySource != dataSource.entitySource) this.entitySource = dataSource.entitySource if (this.root != dataSource.root) this.root = dataSource.root if (this.packagePrefix != dataSource.packagePrefix) this.packagePrefix = dataSource.packagePrefix updateChildToParentReferences(parents) } override var entitySource: EntitySource get() = getEntityData().entitySource set(value) { checkModificationAllowed() getEntityData(true).entitySource = value changedProperty.add("entitySource") } override var root: VirtualFileUrl get() = getEntityData().root set(value) { checkModificationAllowed() getEntityData(true).root = value changedProperty.add("root") val _diff = diff if (_diff != null) index(this, "root", value) } override var packagePrefix: String get() = getEntityData().packagePrefix set(value) { checkModificationAllowed() getEntityData(true).packagePrefix = value changedProperty.add("packagePrefix") } override var module: ModuleEntity.Builder get() { val _diff = diff return if (_diff != null) { @OptIn(EntityStorageInstrumentationApi::class) ((_diff as MutableEntityStorageInstrumentation).getParentBuilder(MODULE_CONNECTION_ID, this) as? ModuleEntity.Builder) ?: (this.entityLinks[EntityLink(false, MODULE_CONNECTION_ID)]!! as ModuleEntity.Builder) } else { this.entityLinks[EntityLink(false, MODULE_CONNECTION_ID)]!! as ModuleEntity.Builder } } set(value) { checkModificationAllowed() val _diff = diff if (_diff != null && value is ModifiableWorkspaceEntityBase<*, *> && value.diff == null) { // Setting backref of the list if (value is ModifiableWorkspaceEntityBase<*, *>) { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -