source: gs3-extensions/atea-nlp-tools/trunk/src/koreromaori-proxy/src/main/java/org/atea/nlptools/koreromaoriinterface/models/TranscriptionResult.java@ 35249

Last change on this file since 35249 was 35249, checked in by davidb, 3 years ago

Prevent one failed request from causing all other transcribed files from being returned
Implement timeout failsafe

File size: 1.7 KB
Line 
1package org.atea.nlptools.koreromaoriinterface.models;
2
3/**
4 * Defines the transcription object received from the Reo Tuhituhi API.
5 */
6public final class TranscriptionResult {
7 private String log;
8 private TranscriptionResultMetadata[] metadata;
9 private String modelVersion;
10 private Boolean success;
11 private String transcription;
12
13 /**
14 * Initialises an empty instance of the {@link TranscriptionResult} class.
15 */
16 public TranscriptionResult() {
17
18 }
19
20 /**
21 * Initialises a new instance of the {@link TranscriptionResult} class.
22 *
23 * @param log
24 * @param metadata
25 * @param modelVersion
26 * @param success
27 * @param transcription
28 */
29 public TranscriptionResult(
30 String log,
31 TranscriptionResultMetadata[] metadata,
32 String modelVersion,
33 Boolean success,
34 String transcription)
35 {
36 this.log = log;
37 this.metadata = metadata;
38 this.modelVersion = modelVersion;
39 this.success = success;
40 this.transcription = transcription;
41 }
42
43 /**
44 * Initialises a new instance of the {@link TranscriptionResult} class, with the intention of logging an unsuccessful result.
45 * As such, each field is set to null bar the provided log, and {@link getSuccess} being set to false.
46 *
47 * @param log
48 */
49 public TranscriptionResult(
50 String log)
51 {
52 this.log = log;
53 this.metadata = null;
54 this.modelVersion = null;
55 this.success = false;
56 this.transcription = null;
57 }
58
59 public String getLog()
60 {
61 return log;
62 }
63
64 public TranscriptionResultMetadata[] getMetadata()
65 {
66 return metadata;
67 }
68
69 public String getModelVersion()
70 {
71 return modelVersion;
72 }
73
74 public Boolean getSuccess()
75 {
76 return success;
77 }
78
79 public String getTranscription()
80 {
81 return transcription;
82 }
83}
Note: See TracBrowser for help on using the repository browser.