persisting_state_of_components.md: add dummy getInstance() method to code sample for clarification, #2

This commit is contained in:
Yann Cébron 2021-10-12 15:08:15 +02:00
parent a77d8ab0ac
commit 3e201fbac3

View File

@ -67,6 +67,11 @@ In the latter case, you can use the following pattern to implement `getState()`
```java ```java
@State(...) @State(...)
class MyService implements PersistentStateComponent<MyService> { class MyService implements PersistentStateComponent<MyService> {
public static MyService getInstance() {
// implementation according to Application/Project level service
}
public String stateValue; public String stateValue;
public MyService getState() { public MyService getState() {