Sun, 10 May 2020 10:58:31 +0200
adds data model for projects and versions
universe@37 | 1 | package de.uapcore.lightpit.entities; |
universe@37 | 2 | |
universe@37 | 3 | import java.util.ArrayList; |
universe@37 | 4 | import java.util.List; |
universe@37 | 5 | import java.util.Objects; |
universe@37 | 6 | |
universe@37 | 7 | public class Project { |
universe@37 | 8 | |
universe@37 | 9 | private final int id; |
universe@37 | 10 | private String name; |
universe@37 | 11 | private String description; |
universe@37 | 12 | private String repoUrl; |
universe@37 | 13 | private User owner; |
universe@37 | 14 | |
universe@37 | 15 | private final List<Version> versions = new ArrayList<>(); |
universe@37 | 16 | |
universe@37 | 17 | public Project(int id) { |
universe@37 | 18 | this.id = id; |
universe@37 | 19 | } |
universe@37 | 20 | |
universe@37 | 21 | public int getId() { |
universe@37 | 22 | return id; |
universe@37 | 23 | } |
universe@37 | 24 | |
universe@37 | 25 | public String getName() { |
universe@37 | 26 | return name; |
universe@37 | 27 | } |
universe@37 | 28 | |
universe@37 | 29 | public void setName(String name) { |
universe@37 | 30 | this.name = name; |
universe@37 | 31 | } |
universe@37 | 32 | |
universe@37 | 33 | public String getDescription() { |
universe@37 | 34 | return description; |
universe@37 | 35 | } |
universe@37 | 36 | |
universe@37 | 37 | public void setDescription(String description) { |
universe@37 | 38 | this.description = description; |
universe@37 | 39 | } |
universe@37 | 40 | |
universe@37 | 41 | public String getRepoUrl() { |
universe@37 | 42 | return repoUrl; |
universe@37 | 43 | } |
universe@37 | 44 | |
universe@37 | 45 | public void setRepoUrl(String repoUrl) { |
universe@37 | 46 | this.repoUrl = repoUrl; |
universe@37 | 47 | } |
universe@37 | 48 | |
universe@37 | 49 | public User getOwner() { |
universe@37 | 50 | return owner; |
universe@37 | 51 | } |
universe@37 | 52 | |
universe@37 | 53 | public void setOwner(User owner) { |
universe@37 | 54 | this.owner = owner; |
universe@37 | 55 | } |
universe@37 | 56 | |
universe@37 | 57 | public List<Version> getVersions() { |
universe@37 | 58 | return versions; |
universe@37 | 59 | } |
universe@37 | 60 | |
universe@37 | 61 | @Override |
universe@37 | 62 | public boolean equals(Object o) { |
universe@37 | 63 | if (this == o) return true; |
universe@37 | 64 | if (o == null || getClass() != o.getClass()) return false; |
universe@37 | 65 | Project project = (Project) o; |
universe@37 | 66 | return id == project.id; |
universe@37 | 67 | } |
universe@37 | 68 | |
universe@37 | 69 | @Override |
universe@37 | 70 | public int hashCode() { |
universe@37 | 71 | return Objects.hash(id); |
universe@37 | 72 | } |
universe@37 | 73 | } |