Last active
April 7, 2020 10:53
-
-
Save balvinder294/fd16a7bd8cf5d9a889161d370cf8ee3f to your computer and use it in GitHub Desktop.
Sample DTO for handling Transcription Response from AWS Transcribe == Tekraze.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dehaze.mvp.service.dto.awstranscribe; | |
import java.io.Serializable; | |
import java.util.Objects; | |
public class TranscriptionResponseDTO implements Serializable { | |
private static final long serialVersionUID = 1L; | |
private String jobName; | |
private String accountId; | |
private TranscriptionResultDTO results; | |
private String status; | |
@Override | |
public boolean equals(Object o) { | |
if (this == o) { | |
return true; | |
} | |
if (o == null || getClass() != o.getClass()) { | |
return false; | |
} | |
TranscriptionResponseDTO transcriptionResponseDTO = (TranscriptionResponseDTO) o; | |
if (transcriptionResponseDTO.getStatus() == null) { | |
return false; | |
} | |
return Objects.equals(getStatus(), transcriptionResponseDTO.getStatus()); | |
} | |
public String getJobName() { return jobName; } | |
public void setJobName(String jobName) { this.jobName = jobName; } | |
public String getAccountId() { return accountId; } | |
public void setAccountId(String accountId) { this.accountId = accountId; } | |
public TranscriptionResultDTO getResults() { return results; } | |
public void setResults(TranscriptionResultDTO results) { this.results = results; } | |
public String getStatus() { return status; } | |
public void setStatus(String status) { this.status = status; } | |
@Override | |
public int hashCode() { | |
return Objects.hashCode(getStatus()); | |
} | |
@Override | |
public String toString() { | |
return "TranscriptionResponseDTO{" + | |
"jobName=" + getJobName() + | |
", accountId='" + getAccountId() + "'" + | |
", status='" + getStatus() + "'" + | |
", results='" + getResults() + "'" + | |
"}"; | |
} | |
} | |
/***** for results field **********/ | |
package dehaze.mvp.service.dto.awstranscribe; | |
import java.io.Serializable; | |
import java.util.List; | |
import java.util.Objects; | |
public class TranscriptionResultDTO implements Serializable { | |
private static final long serialVersionUID = 1L; | |
private List<TranscriptionTextDTO> transcripts; | |
private List<TranscriptionItemDTO> items; | |
@Override | |
public boolean equals(Object o) { | |
if (this == o) { | |
return true; | |
} | |
if (o == null || getClass() != o.getClass()) { | |
return false; | |
} | |
TranscriptionResultDTO transcriptionResultDTO = (TranscriptionResultDTO) o; | |
if (transcriptionResultDTO.getTranscripts() == null) { | |
return false; | |
} | |
return Objects.equals(getTranscripts(), transcriptionResultDTO.getTranscripts()); | |
} | |
public List<TranscriptionTextDTO> getTranscripts() { return transcripts; } | |
public void setTranscripts(List<TranscriptionTextDTO> transcripts) { this.transcripts = transcripts; } | |
public List<TranscriptionItemDTO> getItems() { return items; } | |
public void setItems(List<TranscriptionItemDTO> items) { this.items = items; } | |
@Override | |
public int hashCode() { | |
return Objects.hashCode(getTranscripts()); | |
} | |
@Override | |
public String toString() { | |
return "TranscriptionResultDTO{" + | |
"transcripts=" + getTranscripts() + | |
", items='" + getItems() + "'" + | |
"}"; | |
} | |
} | |
/********* for transcript ****/ | |
package dehaze.mvp.service.dto.awstranscribe; | |
import java.io.Serializable; | |
import java.util.Objects; | |
public class TranscriptionTextDTO implements Serializable { | |
private static final long serialVersionUID = 1L; | |
private String transcript; | |
@Override | |
public boolean equals(Object o) { | |
if (this == o) { | |
return true; | |
} | |
if (o == null || getClass() != o.getClass()) { | |
return false; | |
} | |
TranscriptionTextDTO transcriptionTextDTO = (TranscriptionTextDTO) o; | |
if (transcriptionTextDTO.getTranscript() == null) { | |
return false; | |
} | |
return Objects.equals(getTranscript(), transcriptionTextDTO.getTranscript()); | |
} | |
public String getTranscript() { return transcript; } | |
public void setTranscript(String transcript) { this.transcript = transcript; } | |
@Override | |
public int hashCode() { | |
return Objects.hashCode(getTranscript()); | |
} | |
@Override | |
public String toString() { | |
return "TranscriptionTextDTO{" + | |
"transcript=" + getTranscript() + | |
"}"; | |
} | |
} | |
/****** for items********/ | |
package dehaze.mvp.service.dto.awstranscribe; | |
import java.io.Serializable; | |
import java.util.List; | |
import java.util.Objects; | |
public class TranscriptionItemDTO implements Serializable { | |
private static final long serialVersionUID = 1L; | |
private String start_time; | |
private String end_time; | |
private List<TranscriptionItemAlternativesDTO> alternatives; | |
private String type; | |
@Override | |
public boolean equals(Object o) { | |
if (this == o) { | |
return true; | |
} | |
if (o == null || getClass() != o.getClass()) { | |
return false; | |
} | |
TranscriptionItemDTO transcriptionItemDTO = (TranscriptionItemDTO) o; | |
if (transcriptionItemDTO.getType() == null) { | |
return false; | |
} | |
return Objects.equals(getType(), transcriptionItemDTO.getType()); | |
} | |
public List<TranscriptionItemAlternativesDTO> getAlternatives() { return alternatives; } | |
public void setAlternatives(List<TranscriptionItemAlternativesDTO> alternatives) { this.alternatives = alternatives; } | |
public String getEnd_time() { return end_time; } | |
public void setEnd_time(String end_time) { this.end_time = end_time; } | |
public String getStart_time() { return start_time; } | |
public void setStart_time(String start_time) { this.start_time = start_time; } | |
public String getType() { return type; } | |
public void setType(String type) { this.type = type; } | |
@Override | |
public int hashCode() { | |
return Objects.hashCode(getType()); | |
} | |
@Override | |
public String toString() { | |
return "TranscriptionItemDTO{" + | |
"type=" + getType() + | |
", start_time='" + getStart_time() + "'" + | |
", end_time='" + getEnd_time() + "'" + | |
", alternatives='" + getAlternatives() + "'" + | |
"}"; | |
} | |
} | |
/**** for alternativeItems ****/ | |
package dehaze.mvp.service.dto.awstranscribe; | |
import java.io.Serializable; | |
import java.util.Objects; | |
public class TranscriptionItemAlternativesDTO implements Serializable { | |
private static final long serialVersionUID = 1L; | |
private String confidence; | |
private String content; | |
@Override | |
public boolean equals(Object o) { | |
if (this == o) { | |
return true; | |
} | |
if (o == null || getClass() != o.getClass()) { | |
return false; | |
} | |
TranscriptionItemAlternativesDTO transcriptionItemAlternativesDTO = (TranscriptionItemAlternativesDTO) o; | |
if (transcriptionItemAlternativesDTO.getContent() == null) { | |
return false; | |
} | |
return Objects.equals(getContent(), transcriptionItemAlternativesDTO.getContent()); | |
} | |
public String getConfidence() { return confidence; } | |
public void setConfidence(String confidence) { this.confidence = confidence; } | |
public String getContent() { return content; } | |
public void setContent(String content) { this.content = content; } | |
@Override | |
public int hashCode() { | |
return Objects.hashCode(getContent()); | |
} | |
@Override | |
public String toString() { | |
return "TranscriptionItemAlternativesDTO{" + | |
"content=" + getContent() + | |
", confidence='" + getConfidence() + "'" + | |
"}"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment