Package io.ryos.rhino.sdk.data
Interface Context
-
- All Known Subinterfaces:
UserSession
- All Known Implementing Classes:
ContextImpl
,SimulationSession
,UserSessionImpl
public interface Context
ContextImpl type for storing values throughout a testing session. Each session - and thread respectfully, must have a single context instance bound.- Since:
- 1.0.0
- Author:
- Erhan Bagdemir
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends Context>
Tadd(java.lang.String key, java.lang.Object value)
Puts a new key - value pair to the context.void
commit(java.lang.String status)
void
empty()
Empties the context.<T> java.util.Optional<T>
get(java.lang.String key)
Reclaims the object from the context.boolean
isEmpty()
Checks whether the context is empty.void
notify(long time)
void
register(Measurement measurement)
void
remove(Measurement measurement)
-
-
-
Method Detail
-
add
<T extends Context> T add(java.lang.String key, java.lang.Object value)
Puts a new key - value pair to the context.- Parameters:
key
- Key value.value
- Value to store.
-
get
<T> java.util.Optional<T> get(java.lang.String key)
Reclaims the object from the context.- Type Parameters:
T
- The value stored in the context of typeT
- Parameters:
key
- The key value.- Returns:
- An
Optional
instance ofT
.
-
empty
void empty()
Empties the context.
-
isEmpty
boolean isEmpty()
Checks whether the context is empty.- Returns:
- true if the context is empty.
-
register
void register(Measurement measurement)
-
notify
void notify(long time)
-
commit
void commit(java.lang.String status)
-
remove
void remove(Measurement measurement)
-
-