[space] IDEA-254119: Sign out fully when auth failed and provide way to sign in again
[idea/community.git] / platform / projectModel-api / src / com / intellij / openapi / components / SimplePersistentStateComponent.kt
1 // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
2 package com.intellij.openapi.components
3
4 abstract class SimplePersistentStateComponent<T : BaseState>(initialState: T) : PersistentStateComponentWithModificationTracker<T> {
5   @Volatile
6   private var state: T = initialState
7
8   final override fun getState() = state
9
10   final override fun getStateModificationCount() = state.modificationCount
11
12   override fun loadState(state: T) {
13     this.state = state
14   }
15 }