Skip to content

Commit

Permalink
added sample texts and external product template files
Browse files Browse the repository at this point in the history
  • Loading branch information
Bock4Soft committed Feb 9, 2024
1 parent 7ea1270 commit 70b5619
Show file tree
Hide file tree
Showing 5 changed files with 195 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package online.projektassistent.server.model;

import java.util.Objects;

import javax.validation.constraints.NotBlank;
import java.util.Objects;

@SuppressWarnings("unused")
public class Chapter {

@NotBlank(message = "title is mandatory")
private String title;
private String text;
private String samplesText;

public String getTitle() {
return title;
Expand All @@ -19,6 +19,10 @@ public String getText() {
return text;
}

public String getSamplesText() {
return samplesText;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand All @@ -27,13 +31,15 @@ public boolean equals(Object o) {
Chapter chapter = (Chapter) o;

if (!Objects.equals(title, chapter.title)) return false;
return Objects.equals(text, chapter.text);
if (!Objects.equals(text, chapter.text)) return false;
return Objects.equals(samplesText, chapter.samplesText);
}

@Override
public int hashCode() {
int result = title != null ? title.hashCode() : 0;
result = 31 * result + (text != null ? text.hashCode() : 0);
result = 31 * result + (samplesText != null ? samplesText.hashCode() : 0);
return result;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package online.projektassistent.server.model;

import javax.validation.constraints.NotBlank;
import java.util.Objects;

@SuppressWarnings("unused")
public class ExternalCopyTemplate {

@NotBlank(message = "title is mandatory")
private String title;
@NotBlank(message = "uri is mandatory")
private String uri;

public String getTitle() {
return title;
}

public String getUri() {
return uri;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

ExternalCopyTemplate chapter = (ExternalCopyTemplate) o;

if (!Objects.equals(title, chapter.title)) return false;
return Objects.equals(uri, chapter.uri);
}

@Override
public int hashCode() {
int result = title != null ? title.hashCode() : 0;
result = 31 * result + (uri != null ? uri.hashCode() : 0);
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class ProductOfProject {
@NotEmpty(message = "at least one chapter is mandatory")
private List<Chapter> chapters;

private List<ExternalCopyTemplate> externalCopyTemplates;

public String getProductName() {
return productName;
}
Expand All @@ -41,6 +43,10 @@ public List<Chapter> getChapters() {
return chapters;
}

public List<ExternalCopyTemplate> getExternalCopyTemplates() {
return externalCopyTemplates;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand All @@ -51,6 +57,7 @@ public boolean equals(Object o) {
if (!Objects.equals(productName, singleProduct.productName)) return false;
if (!Objects.equals(responsible, singleProduct.responsible)) return false;
if (!Objects.equals(participants, singleProduct.participants)) return false;
if (!Objects.equals(externalCopyTemplates, singleProduct.externalCopyTemplates)) return false;
return Objects.equals(chapters, singleProduct.chapters);
}

Expand All @@ -60,6 +67,7 @@ public int hashCode() {
result = 31 * result + (responsible != null ? responsible.hashCode() : 0);
result = 31 * result + (participants != null ? participants.hashCode() : 0);
result = 31 * result + (chapters != null ? chapters.hashCode() : 0);
result = 31 * result + (externalCopyTemplates != null ? externalCopyTemplates.hashCode() : 0);
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class SingleProduct {
@NotEmpty(message = "at least one chapter is mandatory")
private List<Chapter> chapters;

private List<ExternalCopyTemplate> externalCopyTemplates;

public String getProductName() {
return productName;
}
Expand All @@ -47,6 +49,10 @@ public List<Chapter> getChapters() {
return chapters;
}

public List<ExternalCopyTemplate> getExternalCopyTemplates() {
return externalCopyTemplates;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand All @@ -58,6 +64,7 @@ public boolean equals(Object o) {
if (!Objects.equals(responsible, singleProduct.responsible)) return false;
if (!Objects.equals(projectName, singleProduct.projectName)) return false;
if (!Objects.equals(participants, singleProduct.participants)) return false;
if (!Objects.equals(externalCopyTemplates, singleProduct.externalCopyTemplates)) return false;
return Objects.equals(chapters, singleProduct.chapters);
}

Expand All @@ -68,6 +75,7 @@ public int hashCode() {
result = 31 * result + (projectName != null ? projectName.hashCode() : 0);
result = 31 * result + (participants != null ? participants.hashCode() : 0);
result = 31 * result + (chapters != null ? chapters.hashCode() : 0);
result = 31 * result + (externalCopyTemplates != null ? externalCopyTemplates.hashCode() : 0);
return result;
}
}
Loading

0 comments on commit 70b5619

Please sign in to comment.