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

Sat, 17 Oct 2020 19:56:50 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 17 Oct 2020 19:56:50 +0200
changeset 134
f47e82cd6077
parent 86
0a658e53177c
child 138
e2aa673dd473
permissions
-rw-r--r--

completes feature: project components

universe@38 1 /*
universe@38 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
universe@38 3 *
universe@38 4 * Copyright 2018 Mike Becker. All rights reserved.
universe@38 5 *
universe@38 6 * Redistribution and use in source and binary forms, with or without
universe@38 7 * modification, are permitted provided that the following conditions are met:
universe@38 8 *
universe@38 9 * 1. Redistributions of source code must retain the above copyright
universe@38 10 * notice, this list of conditions and the following disclaimer.
universe@38 11 *
universe@38 12 * 2. Redistributions in binary form must reproduce the above copyright
universe@38 13 * notice, this list of conditions and the following disclaimer in the
universe@38 14 * documentation and/or other materials provided with the distribution.
universe@38 15 *
universe@38 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
universe@38 17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
universe@38 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
universe@38 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
universe@38 20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
universe@38 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
universe@38 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
universe@38 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
universe@38 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
universe@38 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
universe@38 26 * POSSIBILITY OF SUCH DAMAGE.
universe@38 27 *
universe@38 28 */
universe@37 29 package de.uapcore.lightpit.entities;
universe@37 30
universe@37 31 import java.util.Objects;
universe@37 32
universe@37 33 public class Project {
universe@37 34
universe@37 35 private final int id;
universe@37 36 private String name;
universe@134 37 private String node;
universe@37 38 private String description;
universe@37 39 private String repoUrl;
universe@37 40 private User owner;
universe@37 41
universe@37 42 public Project(int id) {
universe@37 43 this.id = id;
universe@37 44 }
universe@37 45
universe@37 46 public int getId() {
universe@37 47 return id;
universe@37 48 }
universe@37 49
universe@37 50 public String getName() {
universe@37 51 return name;
universe@37 52 }
universe@37 53
universe@37 54 public void setName(String name) {
universe@37 55 this.name = name;
universe@37 56 }
universe@37 57
universe@134 58 public String getNode() {
universe@134 59 return node == null ? String.valueOf(id) : node;
universe@134 60 }
universe@134 61
universe@134 62 public void setNode(String node) {
universe@134 63 this.node = node;
universe@134 64 }
universe@134 65
universe@37 66 public String getDescription() {
universe@37 67 return description;
universe@37 68 }
universe@37 69
universe@37 70 public void setDescription(String description) {
universe@37 71 this.description = description;
universe@37 72 }
universe@37 73
universe@37 74 public String getRepoUrl() {
universe@37 75 return repoUrl;
universe@37 76 }
universe@37 77
universe@37 78 public void setRepoUrl(String repoUrl) {
universe@37 79 this.repoUrl = repoUrl;
universe@37 80 }
universe@37 81
universe@37 82 public User getOwner() {
universe@37 83 return owner;
universe@37 84 }
universe@37 85
universe@37 86 public void setOwner(User owner) {
universe@37 87 this.owner = owner;
universe@37 88 }
universe@37 89
universe@37 90 @Override
universe@37 91 public boolean equals(Object o) {
universe@37 92 if (this == o) return true;
universe@37 93 if (o == null || getClass() != o.getClass()) return false;
universe@37 94 Project project = (Project) o;
universe@37 95 return id == project.id;
universe@37 96 }
universe@37 97
universe@37 98 @Override
universe@37 99 public int hashCode() {
universe@37 100 return Objects.hash(id);
universe@37 101 }
universe@37 102 }

mercurial