Class JsonStringAttributeResponseParser
java.lang.Object
com.cognite.client.servicesV1.response.DefaultResponseParser
com.cognite.client.servicesV1.response.JsonStringAttributeResponseParser
- All Implemented Interfaces:
ResponseParser<String>,Serializable
Parses a single attribute from a json payload as a single item.
A cursor is never returned from this parser.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.cognite.client.servicesV1.response.DefaultResponseParser
instanceId, LOG, MAX_LENGTH_JSON_LOG, objectMapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate()com.google.common.collect.ImmutableList<String>extractItems(String json) Extract the main items from a results json payload.extractNextCursor(String json) Extract the next cursor from a results json payload.withAttributePath(String path) Sets the path to the attribute to extract.Methods inherited from class com.cognite.client.servicesV1.response.DefaultResponseParser
extractItems, extractNextCursor, parseToString
-
Constructor Details
-
JsonStringAttributeResponseParser
public JsonStringAttributeResponseParser()
-
-
Method Details
-
create
-
getAttributePath
-
withAttributePath
Sets the path to the attribute to extract.- Parameters:
path-- Returns:
-
extractNextCursor
Extract the next cursor from a results json payload. Will always return an empty Optional.- Overrides:
extractNextCursorin classDefaultResponseParser- Parameters:
json- The results json payload- Returns:
- Throws:
IOException
-
extractItems
Extract the main items from a results json payload. Returns the entire payload as a json string.- Overrides:
extractItemsin classDefaultResponseParser- Parameters:
json- The results json payload- Returns:
- Throws:
IOExceptionIOExceptionException
-