Skip to content

Commit 6da980e

Browse files
authored
docs(state): Deprecate state, state listener, and global state listener (#129)
1 parent ff027f8 commit 6da980e

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

safebox/src/main/java/com/harrytmthy/safebox/state/SafeBoxGlobalStateObserver.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,15 @@ import java.util.concurrent.ConcurrentHashMap
2121
import java.util.concurrent.CopyOnWriteArraySet
2222

2323
/**
24+
* **Deprecated:** SafeBox is designed to be a drop-in replacement for EncryptedSharedPreferences.
25+
* State updates goes out-of-scope as SafeBox can no longer be closed.
26+
*
2427
* Public observer interface for monitoring SafeBox state changes.
2528
*
2629
* Allows clients to observe SafeBox's lifecycle state transitions for a given file name,
2730
* enabling safer orchestration in multi-screen or asynchronous apps.
2831
*/
32+
@Deprecated(message = "SafeBoxGlobalStateObserver is deprecated and will be removed in v1.4.")
2933
public object SafeBoxGlobalStateObserver {
3034

3135
private val stateHolder = ConcurrentHashMap<String, SafeBoxState>()

safebox/src/main/java/com/harrytmthy/safebox/state/SafeBoxState.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@ package com.harrytmthy.safebox.state
1919
import com.harrytmthy.safebox.SafeBox
2020

2121
/**
22+
* **Deprecated:** SafeBox is designed to be a drop-in replacement for EncryptedSharedPreferences.
23+
* State updates goes out-of-scope as SafeBox can no longer be closed.
24+
*
2225
* Lifecycle state of a [SafeBox] instance.
2326
*
2427
* Emitted to [SafeBoxStateListener] for visibility during async work.
2528
*
2629
* @see SafeBoxStateListener
2730
*/
31+
@Deprecated(message = "SafeBoxState is deprecated and will be removed in v1.4.")
2832
public enum class SafeBoxState {
2933

3034
/**

safebox/src/main/java/com/harrytmthy/safebox/state/SafeBoxStateListener.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@
1717
package com.harrytmthy.safebox.state
1818

1919
/**
20+
* **Deprecated:** SafeBox is designed to be a drop-in replacement for EncryptedSharedPreferences.
21+
* State updates goes out-of-scope as SafeBox can no longer be closed.
22+
*
2023
* A listener interface for observing [SafeBoxState] changes tied to a specific SafeBox file.
2124
*
2225
* This is typically used in non-singleton SafeBox use cases (e.g. ViewModel-scoped),
2326
* where consumers need to track if the instance is starting, writing, or idle.
2427
*
2528
* @see SafeBoxState
2629
*/
30+
@Deprecated(message = "SafeBoxStateListener is deprecated and will be removed in v1.4.")
2731
public fun interface SafeBoxStateListener {
2832

2933
/**

0 commit comments

Comments
 (0)