Add EventContext#asMap to get a view of the context as a map
@@ -119,10 +119,19 @@ public static Builder builder() {
*
* @return All present keys
*/
- public Set<EventContextKey<?>> keys() {
+ public Set<EventContextKey<?>> keySet() {
return this.entries.keySet();
}
+ /**
+ * Gets this event context as a {@link Map} of EventContextKeys to Objects.
+ *
+ * @return A map view of this context
+ */
+ public Map<EventContextKey<?>, Object> asMap() {
+ return this.entries;
+ }
+
@Override
public boolean equals(@Nullable Object object) {
if (object == this) {
