src/main/java/de/uapcore/lightpit/entities/Project.java

Sun, 10 May 2020 10:58:31 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 10 May 2020 10:58:31 +0200
changeset 37
fecda0f466e6
child 38
cf85ef18f231
permissions
-rw-r--r--

adds data model for projects and versions

     1 package de.uapcore.lightpit.entities;
     3 import java.util.ArrayList;
     4 import java.util.List;
     5 import java.util.Objects;
     7 public class Project {
     9     private final int id;
    10     private String name;
    11     private String description;
    12     private String repoUrl;
    13     private User owner;
    15     private final List<Version> versions = new ArrayList<>();
    17     public Project(int id) {
    18         this.id = id;
    19     }
    21     public int getId() {
    22         return id;
    23     }
    25     public String getName() {
    26         return name;
    27     }
    29     public void setName(String name) {
    30         this.name = name;
    31     }
    33     public String getDescription() {
    34         return description;
    35     }
    37     public void setDescription(String description) {
    38         this.description = description;
    39     }
    41     public String getRepoUrl() {
    42         return repoUrl;
    43     }
    45     public void setRepoUrl(String repoUrl) {
    46         this.repoUrl = repoUrl;
    47     }
    49     public User getOwner() {
    50         return owner;
    51     }
    53     public void setOwner(User owner) {
    54         this.owner = owner;
    55     }
    57     public List<Version> getVersions() {
    58         return versions;
    59     }
    61     @Override
    62     public boolean equals(Object o) {
    63         if (this == o) return true;
    64         if (o == null || getClass() != o.getClass()) return false;
    65         Project project = (Project) o;
    66         return id == project.id;
    67     }
    69     @Override
    70     public int hashCode() {
    71         return Objects.hash(id);
    72     }
    73 }

mercurial