Class JsonLongAttributeResponseParser
java.lang.Object
com.cognite.client.servicesV1.response.JsonLongAttributeResponseParser
- All Implemented Interfaces:
ResponseParser<Long>,Serializable
public abstract class JsonLongAttributeResponseParser
extends Object
implements ResponseParser<Long>, 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate()com.google.common.collect.ImmutableList<Long>extractItems(byte[] payload) Extract the results items from a response body.com.google.common.collect.ImmutableList<Long>extractItems(String json) Extract the main items from a results json payload.extractNextCursor(byte[] payload) Extract the next cursor from a response body.extractNextCursor(String json) Extract the next cursor from a results json payload.abstract StringwithAttributePath(String path) Sets the path to the attribute to extract.
-
Field Details
-
LOG
protected final org.slf4j.Logger LOG
-
-
Constructor Details
-
JsonLongAttributeResponseParser
public JsonLongAttributeResponseParser()
-
-
Method Details
-
create
-
toBuilder
-
getAttributePath
-
withAttributePath
Sets the path to the attribute to extract.- Parameters:
path-- Returns:
-
extractNextCursor
Extract the next cursor from a response body.- Specified by:
extractNextCursorin interfaceResponseParser<Long>- Parameters:
payload- The reponse body- Returns:
- Throws:
ExceptionIOException
-
extractNextCursor
Extract the next cursor from a results json payload. Will always return an empty Optional.- Parameters:
json- The results json payload- Returns:
- Throws:
IOException
-
extractItems
Extract the results items from a response body.- Specified by:
extractItemsin interfaceResponseParser<Long>- Parameters:
payload- The reponse body- Returns:
- Throws:
Exception
-
extractItems
Extract the main items from a results json payload. Returns the entire payload as a json string.- Parameters:
json- The results json payload- Returns:
- Throws:
IOExceptionException
-