mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-23 12:58:43 +00:00
35 lines
1 KiB
Java
35 lines
1 KiB
Java
package ee.carlrobert.codegpt.state;
|
|
|
|
import com.intellij.openapi.application.ApplicationManager;
|
|
import com.intellij.openapi.components.PersistentStateComponent;
|
|
import com.intellij.openapi.components.State;
|
|
import com.intellij.openapi.components.Storage;
|
|
import com.intellij.util.xmlb.XmlSerializerUtil;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
@State(
|
|
name = "ee.carlrobert.codegpt.state.AccountDetailsState",
|
|
storages = @Storage("CodeGPTAccountDetails.xml")
|
|
)
|
|
public class AccountDetailsState implements PersistentStateComponent<AccountDetailsState> {
|
|
|
|
public String accountName = "User";
|
|
public Double totalAmountGranted;
|
|
public Double totalAmountUsed;
|
|
|
|
public static AccountDetailsState getInstance() {
|
|
return ApplicationManager.getApplication().getService(AccountDetailsState.class);
|
|
}
|
|
|
|
@Nullable
|
|
@Override
|
|
public AccountDetailsState getState() {
|
|
return this;
|
|
}
|
|
|
|
@Override
|
|
public void loadState(@NotNull AccountDetailsState state) {
|
|
XmlSerializerUtil.copyBean(state, this);
|
|
}
|
|
}
|