sdkcompat/v251/org/jetbrains/bazel/sdkcompat/workspacemodel/entities/impl/BazelProjectDirectoriesEntityImpl.kt [24:365]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @OptIn(WorkspaceEntityInternalApi::class) internal class BazelProjectDirectoriesEntityImpl(private val dataSource: BazelProjectDirectoriesEntityData) : BazelProjectDirectoriesEntity, WorkspaceEntityBase( dataSource) { private companion object { private val connections = listOf( ) } override val projectRoot: VirtualFileUrl get() { readField("projectRoot") return dataSource.projectRoot } override val includedRoots: List get() { readField("includedRoots") return dataSource.includedRoots } override val excludedRoots: List get() { readField("excludedRoots") return dataSource.excludedRoots } override val indexAllFilesInIncludedRoots: Boolean get() { readField("indexAllFilesInIncludedRoots") return dataSource.indexAllFilesInIncludedRoots } override val indexAdditionalFiles: List get() { readField("indexAdditionalFiles") return dataSource.indexAdditionalFiles } override val entitySource: EntitySource get() { readField("entitySource") return dataSource.entitySource } override fun connectionIdList(): List { return connections } internal class Builder(result: BazelProjectDirectoriesEntityData?) : ModifiableWorkspaceEntityBase( result), BazelProjectDirectoriesEntity.Builder { internal constructor() : this(BazelProjectDirectoriesEntityData()) override fun applyToBuilder(builder: MutableEntityStorage) { if (this.diff != null) { if (existsInBuilder(builder)) { this.diff = builder return } else { error("Entity BazelProjectDirectoriesEntity 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, "projectRoot", this.projectRoot) index(this, "includedRoots", this.includedRoots) index(this, "excludedRoots", this.excludedRoots) index(this, "indexAdditionalFiles", this.indexAdditionalFiles) // 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().isProjectRootInitialized()) { error("Field BazelProjectDirectoriesEntity#projectRoot should be initialized") } if (!getEntityData().isIncludedRootsInitialized()) { error("Field BazelProjectDirectoriesEntity#includedRoots should be initialized") } if (!getEntityData().isExcludedRootsInitialized()) { error("Field BazelProjectDirectoriesEntity#excludedRoots should be initialized") } if (!getEntityData().isIndexAdditionalFilesInitialized()) { error("Field BazelProjectDirectoriesEntity#indexAdditionalFiles should be initialized") } } override fun connectionIdList(): List { return connections } override fun afterModification() { val collection_includedRoots = getEntityData().includedRoots if (collection_includedRoots is MutableWorkspaceList<*>) { collection_includedRoots.cleanModificationUpdateAction() } val collection_excludedRoots = getEntityData().excludedRoots if (collection_excludedRoots is MutableWorkspaceList<*>) { collection_excludedRoots.cleanModificationUpdateAction() } val collection_indexAdditionalFiles = getEntityData().indexAdditionalFiles if (collection_indexAdditionalFiles is MutableWorkspaceList<*>) { collection_indexAdditionalFiles.cleanModificationUpdateAction() } } // Relabeling code, move information from dataSource to this builder override fun relabel(dataSource: WorkspaceEntity, parents: Set?) { dataSource as BazelProjectDirectoriesEntity if (this.entitySource != dataSource.entitySource) this.entitySource = dataSource.entitySource if (this.projectRoot != dataSource.projectRoot) this.projectRoot = dataSource.projectRoot if (this.includedRoots != dataSource.includedRoots) this.includedRoots = dataSource.includedRoots.toMutableList() if (this.excludedRoots != dataSource.excludedRoots) this.excludedRoots = dataSource.excludedRoots.toMutableList() if (this.indexAllFilesInIncludedRoots != dataSource.indexAllFilesInIncludedRoots) this.indexAllFilesInIncludedRoots = dataSource.indexAllFilesInIncludedRoots if (this.indexAdditionalFiles != dataSource.indexAdditionalFiles) this.indexAdditionalFiles = dataSource.indexAdditionalFiles.toMutableList() updateChildToParentReferences(parents) } override var entitySource: EntitySource get() = getEntityData().entitySource set(value) { checkModificationAllowed() getEntityData(true).entitySource = value changedProperty.add("entitySource") } override var projectRoot: VirtualFileUrl get() = getEntityData().projectRoot set(value) { checkModificationAllowed() getEntityData(true).projectRoot = value changedProperty.add("projectRoot") val _diff = diff if (_diff != null) index(this, "projectRoot", value) } private val includedRootsUpdater: (value: List) -> Unit = { value -> val _diff = diff if (_diff != null) index(this, "includedRoots", value) changedProperty.add("includedRoots") } override var includedRoots: MutableList get() { val collection_includedRoots = getEntityData().includedRoots if (collection_includedRoots !is MutableWorkspaceList) return collection_includedRoots if (diff == null || modifiable.get()) { collection_includedRoots.setModificationUpdateAction(includedRootsUpdater) } else { collection_includedRoots.cleanModificationUpdateAction() } return collection_includedRoots } set(value) { checkModificationAllowed() getEntityData(true).includedRoots = value includedRootsUpdater.invoke(value) } private val excludedRootsUpdater: (value: List) -> Unit = { value -> val _diff = diff if (_diff != null) index(this, "excludedRoots", value) changedProperty.add("excludedRoots") } override var excludedRoots: MutableList get() { val collection_excludedRoots = getEntityData().excludedRoots if (collection_excludedRoots !is MutableWorkspaceList) return collection_excludedRoots if (diff == null || modifiable.get()) { collection_excludedRoots.setModificationUpdateAction(excludedRootsUpdater) } else { collection_excludedRoots.cleanModificationUpdateAction() } return collection_excludedRoots } set(value) { checkModificationAllowed() getEntityData(true).excludedRoots = value excludedRootsUpdater.invoke(value) } override var indexAllFilesInIncludedRoots: Boolean get() = getEntityData().indexAllFilesInIncludedRoots set(value) { checkModificationAllowed() getEntityData(true).indexAllFilesInIncludedRoots = value changedProperty.add("indexAllFilesInIncludedRoots") } private val indexAdditionalFilesUpdater: (value: List) -> Unit = { value -> val _diff = diff if (_diff != null) index(this, "indexAdditionalFiles", value) changedProperty.add("indexAdditionalFiles") } override var indexAdditionalFiles: MutableList get() { val collection_indexAdditionalFiles = getEntityData().indexAdditionalFiles if (collection_indexAdditionalFiles !is MutableWorkspaceList) return collection_indexAdditionalFiles if (diff == null || modifiable.get()) { collection_indexAdditionalFiles.setModificationUpdateAction(indexAdditionalFilesUpdater) } else { collection_indexAdditionalFiles.cleanModificationUpdateAction() } return collection_indexAdditionalFiles } set(value) { checkModificationAllowed() getEntityData(true).indexAdditionalFiles = value indexAdditionalFilesUpdater.invoke(value) } override fun getEntityClass(): Class = BazelProjectDirectoriesEntity::class.java } } @OptIn(WorkspaceEntityInternalApi::class) internal class BazelProjectDirectoriesEntityData : WorkspaceEntityData() { lateinit var projectRoot: VirtualFileUrl lateinit var includedRoots: MutableList lateinit var excludedRoots: MutableList var indexAllFilesInIncludedRoots: Boolean = false lateinit var indexAdditionalFiles: MutableList internal fun isProjectRootInitialized(): Boolean = ::projectRoot.isInitialized internal fun isIncludedRootsInitialized(): Boolean = ::includedRoots.isInitialized internal fun isExcludedRootsInitialized(): Boolean = ::excludedRoots.isInitialized internal fun isIndexAdditionalFilesInitialized(): Boolean = ::indexAdditionalFiles.isInitialized override fun wrapAsModifiable(diff: MutableEntityStorage): WorkspaceEntity.Builder { val modifiable = BazelProjectDirectoriesEntityImpl.Builder(null) modifiable.diff = diff modifiable.id = createEntityId() return modifiable } @OptIn(EntityStorageInstrumentationApi::class) override fun createEntity(snapshot: EntityStorageInstrumentation): BazelProjectDirectoriesEntity { val entityId = createEntityId() return snapshot.initializeEntity(entityId) { val entity = BazelProjectDirectoriesEntityImpl(this) entity.snapshot = snapshot entity.id = entityId entity } } override fun getMetadata(): EntityMetadata { return MetadataStorageImpl.getMetadataByTypeFqn( "org.jetbrains.bazel.sdkcompat.workspacemodel.entities.BazelProjectDirectoriesEntity") as EntityMetadata } override fun clone(): BazelProjectDirectoriesEntityData { val clonedEntity = super.clone() clonedEntity as BazelProjectDirectoriesEntityData clonedEntity.includedRoots = clonedEntity.includedRoots.toMutableWorkspaceList() clonedEntity.excludedRoots = clonedEntity.excludedRoots.toMutableWorkspaceList() clonedEntity.indexAdditionalFiles = clonedEntity.indexAdditionalFiles.toMutableWorkspaceList() return clonedEntity } override fun getEntityInterface(): Class { return BazelProjectDirectoriesEntity::class.java } override fun createDetachedEntity(parents: List>): WorkspaceEntity.Builder<*> { return BazelProjectDirectoriesEntity(projectRoot, includedRoots, excludedRoots, indexAllFilesInIncludedRoots, indexAdditionalFiles, entitySource) { } } override fun getRequiredParents(): List> { val res = mutableListOf>() return res } override fun equals(other: Any?): Boolean { if (other == null) return false if (this.javaClass != other.javaClass) return false other as BazelProjectDirectoriesEntityData if (this.entitySource != other.entitySource) return false if (this.projectRoot != other.projectRoot) return false if (this.includedRoots != other.includedRoots) return false if (this.excludedRoots != other.excludedRoots) return false if (this.indexAllFilesInIncludedRoots != other.indexAllFilesInIncludedRoots) return false if (this.indexAdditionalFiles != other.indexAdditionalFiles) return false return true } override fun equalsIgnoringEntitySource(other: Any?): Boolean { if (other == null) return false if (this.javaClass != other.javaClass) return false other as BazelProjectDirectoriesEntityData if (this.projectRoot != other.projectRoot) return false if (this.includedRoots != other.includedRoots) return false if (this.excludedRoots != other.excludedRoots) return false if (this.indexAllFilesInIncludedRoots != other.indexAllFilesInIncludedRoots) return false if (this.indexAdditionalFiles != other.indexAdditionalFiles) return false return true } override fun hashCode(): Int { var result = entitySource.hashCode() result = 31 * result + projectRoot.hashCode() result = 31 * result + includedRoots.hashCode() result = 31 * result + excludedRoots.hashCode() result = 31 * result + indexAllFilesInIncludedRoots.hashCode() result = 31 * result + indexAdditionalFiles.hashCode() return result } override fun hashCodeIgnoringEntitySource(): Int { var result = javaClass.hashCode() result = 31 * result + projectRoot.hashCode() result = 31 * result + includedRoots.hashCode() result = 31 * result + excludedRoots.hashCode() result = 31 * result + indexAllFilesInIncludedRoots.hashCode() result = 31 * result + indexAdditionalFiles.hashCode() return result - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sdkcompat/v252/org/jetbrains/bazel/sdkcompat/workspacemodel/entities/impl/BazelProjectDirectoriesEntityImpl.kt [24:365]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @OptIn(WorkspaceEntityInternalApi::class) internal class BazelProjectDirectoriesEntityImpl(private val dataSource: BazelProjectDirectoriesEntityData) : BazelProjectDirectoriesEntity, WorkspaceEntityBase( dataSource) { private companion object { private val connections = listOf( ) } override val projectRoot: VirtualFileUrl get() { readField("projectRoot") return dataSource.projectRoot } override val includedRoots: List get() { readField("includedRoots") return dataSource.includedRoots } override val excludedRoots: List get() { readField("excludedRoots") return dataSource.excludedRoots } override val indexAllFilesInIncludedRoots: Boolean get() { readField("indexAllFilesInIncludedRoots") return dataSource.indexAllFilesInIncludedRoots } override val indexAdditionalFiles: List get() { readField("indexAdditionalFiles") return dataSource.indexAdditionalFiles } override val entitySource: EntitySource get() { readField("entitySource") return dataSource.entitySource } override fun connectionIdList(): List { return connections } internal class Builder(result: BazelProjectDirectoriesEntityData?) : ModifiableWorkspaceEntityBase( result), BazelProjectDirectoriesEntity.Builder { internal constructor() : this(BazelProjectDirectoriesEntityData()) override fun applyToBuilder(builder: MutableEntityStorage) { if (this.diff != null) { if (existsInBuilder(builder)) { this.diff = builder return } else { error("Entity BazelProjectDirectoriesEntity 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, "projectRoot", this.projectRoot) index(this, "includedRoots", this.includedRoots) index(this, "excludedRoots", this.excludedRoots) index(this, "indexAdditionalFiles", this.indexAdditionalFiles) // 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().isProjectRootInitialized()) { error("Field BazelProjectDirectoriesEntity#projectRoot should be initialized") } if (!getEntityData().isIncludedRootsInitialized()) { error("Field BazelProjectDirectoriesEntity#includedRoots should be initialized") } if (!getEntityData().isExcludedRootsInitialized()) { error("Field BazelProjectDirectoriesEntity#excludedRoots should be initialized") } if (!getEntityData().isIndexAdditionalFilesInitialized()) { error("Field BazelProjectDirectoriesEntity#indexAdditionalFiles should be initialized") } } override fun connectionIdList(): List { return connections } override fun afterModification() { val collection_includedRoots = getEntityData().includedRoots if (collection_includedRoots is MutableWorkspaceList<*>) { collection_includedRoots.cleanModificationUpdateAction() } val collection_excludedRoots = getEntityData().excludedRoots if (collection_excludedRoots is MutableWorkspaceList<*>) { collection_excludedRoots.cleanModificationUpdateAction() } val collection_indexAdditionalFiles = getEntityData().indexAdditionalFiles if (collection_indexAdditionalFiles is MutableWorkspaceList<*>) { collection_indexAdditionalFiles.cleanModificationUpdateAction() } } // Relabeling code, move information from dataSource to this builder override fun relabel(dataSource: WorkspaceEntity, parents: Set?) { dataSource as BazelProjectDirectoriesEntity if (this.entitySource != dataSource.entitySource) this.entitySource = dataSource.entitySource if (this.projectRoot != dataSource.projectRoot) this.projectRoot = dataSource.projectRoot if (this.includedRoots != dataSource.includedRoots) this.includedRoots = dataSource.includedRoots.toMutableList() if (this.excludedRoots != dataSource.excludedRoots) this.excludedRoots = dataSource.excludedRoots.toMutableList() if (this.indexAllFilesInIncludedRoots != dataSource.indexAllFilesInIncludedRoots) this.indexAllFilesInIncludedRoots = dataSource.indexAllFilesInIncludedRoots if (this.indexAdditionalFiles != dataSource.indexAdditionalFiles) this.indexAdditionalFiles = dataSource.indexAdditionalFiles.toMutableList() updateChildToParentReferences(parents) } override var entitySource: EntitySource get() = getEntityData().entitySource set(value) { checkModificationAllowed() getEntityData(true).entitySource = value changedProperty.add("entitySource") } override var projectRoot: VirtualFileUrl get() = getEntityData().projectRoot set(value) { checkModificationAllowed() getEntityData(true).projectRoot = value changedProperty.add("projectRoot") val _diff = diff if (_diff != null) index(this, "projectRoot", value) } private val includedRootsUpdater: (value: List) -> Unit = { value -> val _diff = diff if (_diff != null) index(this, "includedRoots", value) changedProperty.add("includedRoots") } override var includedRoots: MutableList get() { val collection_includedRoots = getEntityData().includedRoots if (collection_includedRoots !is MutableWorkspaceList) return collection_includedRoots if (diff == null || modifiable.get()) { collection_includedRoots.setModificationUpdateAction(includedRootsUpdater) } else { collection_includedRoots.cleanModificationUpdateAction() } return collection_includedRoots } set(value) { checkModificationAllowed() getEntityData(true).includedRoots = value includedRootsUpdater.invoke(value) } private val excludedRootsUpdater: (value: List) -> Unit = { value -> val _diff = diff if (_diff != null) index(this, "excludedRoots", value) changedProperty.add("excludedRoots") } override var excludedRoots: MutableList get() { val collection_excludedRoots = getEntityData().excludedRoots if (collection_excludedRoots !is MutableWorkspaceList) return collection_excludedRoots if (diff == null || modifiable.get()) { collection_excludedRoots.setModificationUpdateAction(excludedRootsUpdater) } else { collection_excludedRoots.cleanModificationUpdateAction() } return collection_excludedRoots } set(value) { checkModificationAllowed() getEntityData(true).excludedRoots = value excludedRootsUpdater.invoke(value) } override var indexAllFilesInIncludedRoots: Boolean get() = getEntityData().indexAllFilesInIncludedRoots set(value) { checkModificationAllowed() getEntityData(true).indexAllFilesInIncludedRoots = value changedProperty.add("indexAllFilesInIncludedRoots") } private val indexAdditionalFilesUpdater: (value: List) -> Unit = { value -> val _diff = diff if (_diff != null) index(this, "indexAdditionalFiles", value) changedProperty.add("indexAdditionalFiles") } override var indexAdditionalFiles: MutableList get() { val collection_indexAdditionalFiles = getEntityData().indexAdditionalFiles if (collection_indexAdditionalFiles !is MutableWorkspaceList) return collection_indexAdditionalFiles if (diff == null || modifiable.get()) { collection_indexAdditionalFiles.setModificationUpdateAction(indexAdditionalFilesUpdater) } else { collection_indexAdditionalFiles.cleanModificationUpdateAction() } return collection_indexAdditionalFiles } set(value) { checkModificationAllowed() getEntityData(true).indexAdditionalFiles = value indexAdditionalFilesUpdater.invoke(value) } override fun getEntityClass(): Class = BazelProjectDirectoriesEntity::class.java } } @OptIn(WorkspaceEntityInternalApi::class) internal class BazelProjectDirectoriesEntityData : WorkspaceEntityData() { lateinit var projectRoot: VirtualFileUrl lateinit var includedRoots: MutableList lateinit var excludedRoots: MutableList var indexAllFilesInIncludedRoots: Boolean = false lateinit var indexAdditionalFiles: MutableList internal fun isProjectRootInitialized(): Boolean = ::projectRoot.isInitialized internal fun isIncludedRootsInitialized(): Boolean = ::includedRoots.isInitialized internal fun isExcludedRootsInitialized(): Boolean = ::excludedRoots.isInitialized internal fun isIndexAdditionalFilesInitialized(): Boolean = ::indexAdditionalFiles.isInitialized override fun wrapAsModifiable(diff: MutableEntityStorage): WorkspaceEntity.Builder { val modifiable = BazelProjectDirectoriesEntityImpl.Builder(null) modifiable.diff = diff modifiable.id = createEntityId() return modifiable } @OptIn(EntityStorageInstrumentationApi::class) override fun createEntity(snapshot: EntityStorageInstrumentation): BazelProjectDirectoriesEntity { val entityId = createEntityId() return snapshot.initializeEntity(entityId) { val entity = BazelProjectDirectoriesEntityImpl(this) entity.snapshot = snapshot entity.id = entityId entity } } override fun getMetadata(): EntityMetadata { return MetadataStorageImpl.getMetadataByTypeFqn( "org.jetbrains.bazel.sdkcompat.workspacemodel.entities.BazelProjectDirectoriesEntity") as EntityMetadata } override fun clone(): BazelProjectDirectoriesEntityData { val clonedEntity = super.clone() clonedEntity as BazelProjectDirectoriesEntityData clonedEntity.includedRoots = clonedEntity.includedRoots.toMutableWorkspaceList() clonedEntity.excludedRoots = clonedEntity.excludedRoots.toMutableWorkspaceList() clonedEntity.indexAdditionalFiles = clonedEntity.indexAdditionalFiles.toMutableWorkspaceList() return clonedEntity } override fun getEntityInterface(): Class { return BazelProjectDirectoriesEntity::class.java } override fun createDetachedEntity(parents: List>): WorkspaceEntity.Builder<*> { return BazelProjectDirectoriesEntity(projectRoot, includedRoots, excludedRoots, indexAllFilesInIncludedRoots, indexAdditionalFiles, entitySource) { } } override fun getRequiredParents(): List> { val res = mutableListOf>() return res } override fun equals(other: Any?): Boolean { if (other == null) return false if (this.javaClass != other.javaClass) return false other as BazelProjectDirectoriesEntityData if (this.entitySource != other.entitySource) return false if (this.projectRoot != other.projectRoot) return false if (this.includedRoots != other.includedRoots) return false if (this.excludedRoots != other.excludedRoots) return false if (this.indexAllFilesInIncludedRoots != other.indexAllFilesInIncludedRoots) return false if (this.indexAdditionalFiles != other.indexAdditionalFiles) return false return true } override fun equalsIgnoringEntitySource(other: Any?): Boolean { if (other == null) return false if (this.javaClass != other.javaClass) return false other as BazelProjectDirectoriesEntityData if (this.projectRoot != other.projectRoot) return false if (this.includedRoots != other.includedRoots) return false if (this.excludedRoots != other.excludedRoots) return false if (this.indexAllFilesInIncludedRoots != other.indexAllFilesInIncludedRoots) return false if (this.indexAdditionalFiles != other.indexAdditionalFiles) return false return true } override fun hashCode(): Int { var result = entitySource.hashCode() result = 31 * result + projectRoot.hashCode() result = 31 * result + includedRoots.hashCode() result = 31 * result + excludedRoots.hashCode() result = 31 * result + indexAllFilesInIncludedRoots.hashCode() result = 31 * result + indexAdditionalFiles.hashCode() return result } override fun hashCodeIgnoringEntitySource(): Int { var result = javaClass.hashCode() result = 31 * result + projectRoot.hashCode() result = 31 * result + includedRoots.hashCode() result = 31 * result + excludedRoots.hashCode() result = 31 * result + indexAllFilesInIncludedRoots.hashCode() result = 31 * result + indexAdditionalFiles.hashCode() return result - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -