Package com.couchbase.client.core.cnc
Class AbstractContext
java.lang.Object
com.couchbase.client.core.cnc.AbstractContext
- All Implemented Interfaces:
Context
- Direct Known Subclasses:
CoreContext
,ErrorContext
,ProtostellarContext
,RangeScanContext
,WaitUntilReadyContext
Common parent method for all contexts.
Contexts are encouraged to derive from this abstract class because all they have
to do then is to implement/override injectExportableParams(Map)
and feed
the data they want to be extracted. The actual extraction and formatting then
comes for free.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.couchbase.client.core.cnc.Context
Context.ExportFormat
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionExport this context into a generic map.exportAsString
(Context.ExportFormat format) Export this context into the specified format.void
injectExportableParams
(Map<String, Object> input) This method needs to be implemented by the actual context implementations to inject the params they need for exporting.toString()
-
Constructor Details
-
AbstractContext
public AbstractContext()
-
-
Method Details
-
injectExportableParams
This method needs to be implemented by the actual context implementations to inject the params they need for exporting.- Parameters:
input
- pass exportable params in here.
-
exportAsString
Description copied from interface:Context
Export this context into the specified format.- Specified by:
exportAsString
in interfaceContext
- Parameters:
format
- the format to export into.- Returns:
- the exported format as a string representation.
-
exportAsMap
Description copied from interface:Context
Export this context into a generic map.- Specified by:
exportAsMap
in interfaceContext
- Returns:
- the exported format in a generic map representation.
-
toString
-