101 lines
2.1 KiB
Java
101 lines
2.1 KiB
Java
package com.example.questionbank.service.dto;
|
|
|
|
import jakarta.validation.constraints.*;
|
|
import java.io.Serializable;
|
|
import java.util.Objects;
|
|
|
|
/**
|
|
* A DTO for the {@link com.example.questionbank.domain.Question} entity.
|
|
*/
|
|
@SuppressWarnings("common-java:DuplicatedBlocks")
|
|
public class QuestionDTO implements Serializable {
|
|
|
|
private Long id;
|
|
|
|
@NotNull
|
|
@Size(min = 5, max = 2000)
|
|
private String prompt;
|
|
|
|
@Size(max = 2000)
|
|
private String explanation;
|
|
|
|
@NotNull
|
|
private Boolean active;
|
|
|
|
@NotNull
|
|
private SubjectDTO subject;
|
|
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(Long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getPrompt() {
|
|
return prompt;
|
|
}
|
|
|
|
public void setPrompt(String prompt) {
|
|
this.prompt = prompt;
|
|
}
|
|
|
|
public String getExplanation() {
|
|
return explanation;
|
|
}
|
|
|
|
public void setExplanation(String explanation) {
|
|
this.explanation = explanation;
|
|
}
|
|
|
|
public Boolean getActive() {
|
|
return active;
|
|
}
|
|
|
|
public void setActive(Boolean active) {
|
|
this.active = active;
|
|
}
|
|
|
|
public SubjectDTO getSubject() {
|
|
return subject;
|
|
}
|
|
|
|
public void setSubject(SubjectDTO subject) {
|
|
this.subject = subject;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (!(o instanceof QuestionDTO)) {
|
|
return false;
|
|
}
|
|
|
|
QuestionDTO questionDTO = (QuestionDTO) o;
|
|
if (this.id == null) {
|
|
return false;
|
|
}
|
|
return Objects.equals(this.id, questionDTO.id);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(this.id);
|
|
}
|
|
|
|
// prettier-ignore
|
|
@Override
|
|
public String toString() {
|
|
return "QuestionDTO{" +
|
|
"id=" + getId() +
|
|
", prompt='" + getPrompt() + "'" +
|
|
", explanation='" + getExplanation() + "'" +
|
|
", active='" + getActive() + "'" +
|
|
", subject=" + getSubject() +
|
|
"}";
|
|
}
|
|
}
|