Update Home
6
Home.md
6
Home.md
@@ -9,6 +9,7 @@
|
|||||||
- Change notifications via weakly-referenced listeners
|
- Change notifications via weakly-referenced listeners
|
||||||
- Thread-safe and simple to use
|
- Thread-safe and simple to use
|
||||||
- Singleton style with enum
|
- Singleton style with enum
|
||||||
|
- **Multiple independent named contexts** for modular, isolated data storage
|
||||||
|
|
||||||
## Quick Link
|
## Quick Link
|
||||||
|
|
||||||
@@ -23,6 +24,11 @@
|
|||||||
```java
|
```java
|
||||||
Key<Integer> counterKey = Key.of("counter", Integer.class);
|
Key<Integer> counterKey = Key.of("counter", Integer.class);
|
||||||
Ctx.INSTANCE.put(counterKey, 42);
|
Ctx.INSTANCE.put(counterKey, 42);
|
||||||
|
|
||||||
|
// Working with multiple named contexts
|
||||||
|
CtxInterface orderCtx = Ctx.INSTANCE.getContext("order");
|
||||||
|
Key<String> orderIdKey = Key.of("orderId", String.class);
|
||||||
|
orderCtx.put(orderIdKey, "ORD123");
|
||||||
````
|
````
|
||||||
|
|
||||||
Enjoy consistent, simple context management!
|
Enjoy consistent, simple context management!
|
||||||
Reference in New Issue
Block a user