Package com.basistech.rosette.apimodel
Class DocumentRequest<O extends Options>
java.lang.Object
com.basistech.rosette.apimodel.Request
com.basistech.rosette.apimodel.DocumentRequest<O>
This class represents the common information for all document processing requests to the Rosette API.
Most applications do not use this class directly; the methods of the
On the wire, a request is a json object. All the endpoints accept the same set of items, represented here, that describe the input document.
Applications specify the text to process in three ways:
RosetteAPI
class
create request objects. More complex applications may create objects of
this class for themselves via the DocumentRequest.DocumentRequestBuilder
.
On the wire, a request is a json object. All the endpoints accept the same set of items, represented here, that describe the input document.
Applications specify the text to process in three ways:
- Plain text, as the
content
item in the Json object. - A binary file image, attached as an additional MIME part to the request.
The application provides a MIME content type in
contentType
. - A URL of a data to download. The application provides the URL in
contentUri
. Note that the Rosette API respects the content type returned by the server for downloaded data.
Object
; it contains a String
for plain text, or an InputStream
for binary data. DocumentRequest.DocumentRequestBuilder
provides several alternative methods for setting this information.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDocumentRequest
(String profileId, com.basistech.util.LanguageCode language, Object content, String contentUri, String contentType, String genre, O options) DocumentRequest
(String profileId, com.basistech.util.LanguageCode language, Object content, String contentUri, String contentType, O options) -
Method Summary
Modifier and TypeMethodDescriptionstatic <O extends Options>
DocumentRequest.DocumentRequestBuilder<O>builder()
protected boolean
boolean
get content to process if it's a String.get the content as an array of bytesgetGenre()
Deprecated.com.basistech.util.LanguageCode
get content as an objectint
hashCode()
toString()
Methods inherited from class com.basistech.rosette.apimodel.Request
getProfileId, setProfileId
-
Constructor Details
-
DocumentRequest
-
DocumentRequest
-
-
Method Details
-
getContent
get content to process if it's a String.- Returns:
- the content if a String, else null.
-
getContentBytes
get the content as an array of bytes- Returns:
- the content as bytes
-
getRawContent
get content as an object- Returns:
- the content as object
-
builder
-
getLanguage
public com.basistech.util.LanguageCode getLanguage()- Returns:
- the language code
-
getContentUri
- Returns:
- the URI of request content
-
getContentType
- Returns:
- request content type
-
getGenre
Deprecated.- Returns:
- request genre
-
getOptions
- Returns:
- request options
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-