Package com.couchbase.client.core.utils
Class Events
- java.lang.Object
-
- com.couchbase.client.core.utils.Events
-
public class Events extends Object
Utility methods for event handling.- Since:
- 1.2.0
- Author:
- Michael Nitschinger
-
-
Constructor Summary
Constructors Constructor Description Events()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,Object>
identityMap(CouchbaseEvent source)
Takes aCouchbaseEvent
and returns a map with event information.static String
toJson(CouchbaseEvent source, boolean pretty)
Takes aCouchbaseEvent
and generates a JSON string.
-
-
-
Method Detail
-
identityMap
public static Map<String,Object> identityMap(CouchbaseEvent source)
Takes aCouchbaseEvent
and returns a map with event information.- Parameters:
source
- the source event.- Returns:
- a new map which contains name and type info in an event sub-map.
-
toJson
public static String toJson(CouchbaseEvent source, boolean pretty)
Takes aCouchbaseEvent
and generates a JSON string.- Parameters:
source
- the source event.pretty
- if pretty print should be used.- Returns:
- the generated json string.
-
-