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
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.
-
Constructor Details
-
Events
public Events()
-
-
Method Details
-
identityMap
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
Takes aCouchbaseEvent
and generates a JSON string.- Parameters:
source
- the source event.pretty
- if pretty print should be used.- Returns:
- the generated json string.
-