Interface TextResult
-
- All Superinterfaces:
Result
- All Known Implementing Classes:
StringTextResult
public interface TextResult extends Result
A text result is result type which has been produced by aJob
and is processed byactions
.
By convention, it always implies the flavorTEXT
.
Not allResultAction
can handle eachFileResult
,result flavors
define the kind of information/data aFileResult
represents and actions will handle only results they support. A result can be processed by more than oneResultAction
.- Since:
- taskplanner 3.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.List<ResultFlavor>
getFlavors()
Defined the types of data this Result contains.java.lang.String
getText()
Returns the content of the result in form of aString
.java.io.InputStream
getTextContent()
Returns the content of the result in form of anInputStream
with encodingStandardCharsets.UTF_8
.java.lang.String
getTextContentType()
Get the MIME type this result has.-
Methods inherited from interface com.inet.taskplanner.server.api.result.Result
cleanup, supportsFlavor, supportsOneFlavorOf
-
-
-
-
Method Detail
-
getText
java.lang.String getText() throws java.io.IOException
Returns the content of the result in form of aString
. The actual interpretation of the content depends on the type as returned bygetTextContentType()
.- Returns:
- the content as
String
- Throws:
java.io.IOException
- thrown if the content is created on demand and the creation failed- Since:
- taskplanner 3.0
-
getTextContent
java.io.InputStream getTextContent() throws java.io.IOException
Returns the content of the result in form of anInputStream
with encodingStandardCharsets.UTF_8
. The actual interpretation of the content depends on the type as returned bygetTextContentType()
.- Returns:
- the content as
String
- Throws:
java.io.IOException
- thrown if the content is created on demand and the creation failed- Since:
- taskplanner 3.0
-
getTextContentType
java.lang.String getTextContentType() throws java.lang.Exception
Get the MIME type this result has.- Returns:
- the content type of this result. When
null
, 'text/plain' is to be used. - Throws:
java.lang.Exception
- if the type is could not be determined due to an IO problem- Since:
- taskplanner 3.0
-
getFlavors
default java.util.List<ResultFlavor> getFlavors()
Defined the types of data this Result contains.- Specified by:
getFlavors
in interfaceResult
- Returns:
- the
ResultFlavor
of this Result.
-
-