Add "Assignment", "Task" and "Error" classes.

This commit is contained in:
Lampros Smyrnaios 2021-04-15 03:36:08 +03:00
parent c6e12d3e95
commit 89c6a73a30
3 changed files with 124 additions and 0 deletions

View File

@ -0,0 +1,52 @@
package eu.openaire.urls_controller.models;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Date;
import java.util.List;
public class Assignment {
@JsonProperty("tasks")
List<Task> tasks;
@JsonProperty("workerId")
String workerId;
@JsonProperty("date")
Date date;
public List<Task> getTasks() {
return tasks;
}
public void setTasks(List<Task> tasks) {
this.tasks = tasks;
}
public String getWorkerId() {
return workerId;
}
public void setWorkerId(String workerId) {
this.workerId = workerId;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
@Override
public String toString() {
return "Assignment{" +
"tasks=" + tasks +
", workerId='" + workerId + '\'' +
", date=" + date +
'}';
}
}

View File

@ -0,0 +1,36 @@
package eu.openaire.urls_controller.models;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Error {
@JsonProperty("type")
String type;
@JsonProperty("message")
String message;
public String getType() {
return type;
}
public void setType(String type) {
type = type;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public String toString() {
return "Error{" +
"type='" + type + '\'' +
", message='" + message + '\'' +
'}';
}
}

View File

@ -0,0 +1,36 @@
package eu.openaire.urls_controller.models;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Task {
@JsonProperty("id")
String id;
@JsonProperty("url")
String url;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
@Override
public String toString() {
return "Task{" +
"id='" + id + '\'' +
", url='" + url + '\'' +
'}';
}
}