|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.github.fge.jsonschema.core.processing.ProcessingResult<R>
R - type of the processing outputpublic final class ProcessingResult<R extends MessageProvider>
Wrapper class over a processing result
This class is useful when you write your own wrappers over processors and want to be able to customize the output for said classes. It offers two static factory methods and offers the ability to grab the processing result, the processing report and the success status.
It also offers a wrapper which swallows ProcessingExceptions and
wraps them in a report instead (which will always be a ListProcessingReport: in this case, the exception message will always be
the first message in the report.
| Method Summary | ||
|---|---|---|
ProcessingReport |
getReport()
Get the report out of this result |
|
R |
getResult()
Get the result of the computation |
|
boolean |
isSuccess()
Tell whether the result is a success |
|
static
|
of(Processor<IN,OUT> processor,
ProcessingReport report,
IN input)
Build a result out of a processor, a report and an input |
|
static
|
uncheckedResult(Processor<IN,OUT> processor,
ProcessingReport report,
IN input)
Build a result out of a computation and wrap any processing exception |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <IN extends MessageProvider,OUT extends MessageProvider> ProcessingResult<OUT> of(Processor<IN,OUT> processor,
ProcessingReport report,
IN input)
throws ProcessingException
IN - type of the inputOUT - type of the outputprocessor - the processorreport - the reportinput - the input
ProcessingException - processing failed
NullPointerException - the processor or report are null
public static <IN extends MessageProvider,OUT extends MessageProvider> ProcessingResult<OUT> uncheckedResult(Processor<IN,OUT> processor,
ProcessingReport report,
IN input)
IN - type of the inputOUT - type of the outputprocessor - the processor to usereport - the report to useinput - the input
NullPointerException - the processor or report are nullpublic ProcessingReport getReport()
public R getResult()
Note that in the event of a processing failure, the return value of this method is undefined.
public boolean isSuccess()
ProcessingReport.isSuccess()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||