From 71ec7bb7261d708e7a3aaf8bf934dd54157f2709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D0=BC=D0=B5=D0=BD=D0=BE=D0=B2=D0=B0=20=D0=9C?= =?UTF-8?q?=D0=B0=D1=80=D0=B8=D1=8F?= Date: Thu, 25 Apr 2019 22:08:24 +0400 Subject: [PATCH] #108 add reference dto --- .../ru/ulstu/paper/model/ReferenceDto.java | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 src/main/java/ru/ulstu/paper/model/ReferenceDto.java diff --git a/src/main/java/ru/ulstu/paper/model/ReferenceDto.java b/src/main/java/ru/ulstu/paper/model/ReferenceDto.java new file mode 100644 index 0000000..8d71ae5 --- /dev/null +++ b/src/main/java/ru/ulstu/paper/model/ReferenceDto.java @@ -0,0 +1,129 @@ +package ru.ulstu.paper.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ReferenceDto { + public enum ReferenceType { + ARTICLE("Статья"), + BOOK("Книга"); + + private String typeName; + + ReferenceType(String name) { + this.typeName = name; + } + + public String getTypeName() { + return typeName; + } + } + + public enum FormatStandard { + GOST("ГОСТ"), + SPRINGER("Springer"); + + private String standardName; + + FormatStandard(String name) { + this.standardName = name; + } + + public String getStandardName() { + return standardName; + } + } + + private String authors; + private String publicationTitle; + private Integer publicationYear; + private String publisher; + private String pages; + private String journalOrCollectionTitle; + private ReferenceType referenceType; + private FormatStandard formatStandard; + + @JsonCreator + public ReferenceDto( + @JsonProperty("authors") String authors, + @JsonProperty("publicationTitle") String publicationTitle, + @JsonProperty("publicationYear") Integer publicationYear, + @JsonProperty("publisher") String publisher, + @JsonProperty("pages") String pages, + @JsonProperty("journalOrCollectionTitle") String journalOrCollectionTitle, + @JsonProperty("referenceType") ReferenceType referenceType, + @JsonProperty("formatStandard") FormatStandard formatStandard) { + this.authors = authors; + this.publicationTitle = publicationTitle; + this.publicationYear = publicationYear; + this.publisher = publisher; + this.pages = pages; + this.journalOrCollectionTitle = journalOrCollectionTitle; + this.referenceType = referenceType; + this.formatStandard = formatStandard; + } + + public String getAuthors() { + return authors; + } + + public void setAuthors(String authors) { + this.authors = authors; + } + + public String getPublicationTitle() { + return publicationTitle; + } + + public void setPublicationTitle(String publicationTitle) { + this.publicationTitle = publicationTitle; + } + + public Integer getPublicationYear() { + return publicationYear; + } + + public void setPublicationYear(Integer publicationYear) { + this.publicationYear = publicationYear; + } + + public String getPublisher() { + return publisher; + } + + public void setPublisher(String publisher) { + this.publisher = publisher; + } + + public String getPages() { + return pages; + } + + public void setPages(String pages) { + this.pages = pages; + } + + public String getJournalOrCollectionTitle() { + return journalOrCollectionTitle; + } + + public void setJournalOrCollectionTitle(String journalOrCollectionTitle) { + this.journalOrCollectionTitle = journalOrCollectionTitle; + } + + public ReferenceType getReferenceType() { + return referenceType; + } + + public void setReferenceType(ReferenceType referenceType) { + this.referenceType = referenceType; + } + + public FormatStandard getFormatStandard() { + return formatStandard; + } + + public void setFormatStandard(FormatStandard formatStandard) { + this.formatStandard = formatStandard; + } +}