Class FileBinaryResponseParser
- java.lang.Object
-
- com.cognite.client.servicesV1.response.FileBinaryResponseParser
-
- All Implemented Interfaces:
ResponseParser<FileBinary>
public abstract class FileBinaryResponseParser extends Object implements ResponseParser<FileBinary>
Parses a file binary based on a request and binary response payload. The request parameters must contain a single item with either the *externalId* or the *id*. The response payload represents the file binary.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileBinaryResponseParser.Builder
-
Constructor Summary
Constructors Constructor Description FileBinaryResponseParser()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static FileBinaryResponseParsercreate()com.google.common.collect.ImmutableList<FileBinary>extractItems(byte[] payload)Extract the file binary from the response body.Optional<String>extractNextCursor(byte[] payload)ReturnsOptional.empty()as there is no next cursor in a file binary response.static FileBinaryResponseParserof(Request requestParameters)abstract FileBinaryResponseParser.BuildertoBuilder()FileBinaryResponseParserwithRequest(Request requestParameters)
-
-
-
Method Detail
-
create
public static FileBinaryResponseParser create()
-
of
public static FileBinaryResponseParser of(Request requestParameters)
-
toBuilder
public abstract FileBinaryResponseParser.Builder toBuilder()
-
withRequest
public FileBinaryResponseParser withRequest(Request requestParameters)
-
extractNextCursor
public Optional<String> extractNextCursor(byte[] payload) throws Exception
ReturnsOptional.empty()as there is no next cursor in a file binary response.- Specified by:
extractNextCursorin interfaceResponseParser<FileBinary>- Parameters:
payload- The response body- Returns:
- Throws:
ExceptionIOException
-
extractItems
public com.google.common.collect.ImmutableList<FileBinary> extractItems(byte[] payload) throws Exception
Extract the file binary from the response body.- Specified by:
extractItemsin interfaceResponseParser<FileBinary>- Parameters:
payload- The reponse body- Returns:
- Throws:
Exception
-
-