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

Sat, 30 May 2020 15:26:15 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 30 May 2020 15:26:15 +0200
changeset 81
1a2e7b5d48f7
parent 75
33b6843fdf8a
child 86
0a658e53177c
permissions
-rw-r--r--

adds issue summaries

universe@62 1 /*
universe@62 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
universe@62 3 *
universe@62 4 * Copyright 2018 Mike Becker. All rights reserved.
universe@62 5 *
universe@62 6 * Redistribution and use in source and binary forms, with or without
universe@62 7 * modification, are permitted provided that the following conditions are met:
universe@62 8 *
universe@62 9 * 1. Redistributions of source code must retain the above copyright
universe@62 10 * notice, this list of conditions and the following disclaimer.
universe@62 11 *
universe@62 12 * 2. Redistributions in binary form must reproduce the above copyright
universe@62 13 * notice, this list of conditions and the following disclaimer in the
universe@62 14 * documentation and/or other materials provided with the distribution.
universe@62 15 *
universe@62 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
universe@62 17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
universe@62 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
universe@62 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
universe@62 20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
universe@62 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
universe@62 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
universe@62 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
universe@62 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
universe@62 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
universe@62 26 * POSSIBILITY OF SUCH DAMAGE.
universe@62 27 *
universe@62 28 */
universe@62 29 package de.uapcore.lightpit.entities;
universe@62 30
universe@62 31 import java.sql.Date;
universe@62 32 import java.sql.Timestamp;
universe@75 33 import java.time.Instant;
universe@75 34 import java.util.Collections;
universe@62 35 import java.util.List;
universe@62 36 import java.util.Objects;
universe@62 37
universe@62 38 public final class Issue {
universe@62 39
universe@75 40 private int id;
universe@62 41 private final Project project;
universe@62 42
universe@62 43 private IssueStatus status;
universe@62 44 private IssueCategory category;
universe@62 45
universe@62 46 private String subject;
universe@62 47 private String description;
universe@75 48 private User assignee;
universe@62 49
universe@75 50 private List<Version> affectedVersions = Collections.emptyList();
universe@75 51 private List<Version> scheduledVersions = Collections.emptyList();
universe@75 52 private List<Version> resolvedVersions = Collections.emptyList();
universe@62 53
universe@75 54 private Timestamp created = Timestamp.from(Instant.now());
universe@75 55 private Timestamp updated = Timestamp.from(Instant.now());
universe@62 56 private Date eta;
universe@62 57
universe@62 58 public Issue(int id, Project project) {
universe@62 59 this.id = id;
universe@62 60 this.project = project;
universe@62 61 }
universe@62 62
universe@62 63 public int getId() {
universe@62 64 return id;
universe@62 65 }
universe@62 66
universe@75 67 /**
universe@75 68 * Should only be used by a DAO to store the generated ID.
universe@75 69 * @param id the freshly generated ID returned from the database after insert
universe@75 70 */
universe@75 71 public void setId(int id) {
universe@75 72 this.id = id;
universe@75 73 }
universe@75 74
universe@62 75 public Project getProject() {
universe@62 76 return project;
universe@62 77 }
universe@62 78
universe@62 79 public IssueStatus getStatus() {
universe@62 80 return status;
universe@62 81 }
universe@62 82
universe@62 83 public void setStatus(IssueStatus status) {
universe@62 84 this.status = status;
universe@62 85 }
universe@62 86
universe@81 87 public int getPhase() {
universe@81 88 return this.status.getPhase();
universe@81 89 }
universe@81 90
universe@62 91 public IssueCategory getCategory() {
universe@62 92 return category;
universe@62 93 }
universe@62 94
universe@62 95 public void setCategory(IssueCategory category) {
universe@62 96 this.category = category;
universe@62 97 }
universe@62 98
universe@62 99 public String getSubject() {
universe@62 100 return subject;
universe@62 101 }
universe@62 102
universe@62 103 public void setSubject(String subject) {
universe@62 104 this.subject = subject;
universe@62 105 }
universe@62 106
universe@62 107 public String getDescription() {
universe@62 108 return description;
universe@62 109 }
universe@62 110
universe@62 111 public void setDescription(String description) {
universe@62 112 this.description = description;
universe@62 113 }
universe@62 114
universe@75 115 public User getAssignee() {
universe@75 116 return assignee;
universe@75 117 }
universe@75 118
universe@75 119 public void setAssignee(User assignee) {
universe@75 120 this.assignee = assignee;
universe@75 121 }
universe@75 122
universe@62 123 public List<Version> getAffectedVersions() {
universe@62 124 return affectedVersions;
universe@62 125 }
universe@62 126
universe@62 127 public void setAffectedVersions(List<Version> affectedVersions) {
universe@62 128 this.affectedVersions = affectedVersions;
universe@62 129 }
universe@62 130
universe@75 131 public List<Version> getScheduledVersions() {
universe@75 132 return scheduledVersions;
universe@62 133 }
universe@62 134
universe@75 135 public void setScheduledVersions(List<Version> scheduledVersions) {
universe@75 136 this.scheduledVersions = scheduledVersions;
universe@62 137 }
universe@62 138
universe@75 139 public List<Version> getResolvedVersions() {
universe@75 140 return resolvedVersions;
universe@62 141 }
universe@62 142
universe@75 143 public void setResolvedVersions(List<Version> resolvedVersions) {
universe@75 144 this.resolvedVersions = resolvedVersions;
universe@62 145 }
universe@62 146
universe@62 147 public Timestamp getCreated() {
universe@62 148 return created;
universe@62 149 }
universe@62 150
universe@62 151 public void setCreated(Timestamp created) {
universe@62 152 this.created = created;
universe@62 153 }
universe@62 154
universe@62 155 public Timestamp getUpdated() {
universe@62 156 return updated;
universe@62 157 }
universe@62 158
universe@62 159 public void setUpdated(Timestamp updated) {
universe@62 160 this.updated = updated;
universe@62 161 }
universe@62 162
universe@62 163 public Date getEta() {
universe@62 164 return eta;
universe@62 165 }
universe@62 166
universe@62 167 public void setEta(Date eta) {
universe@62 168 this.eta = eta;
universe@62 169 }
universe@62 170
universe@62 171 @Override
universe@62 172 public boolean equals(Object o) {
universe@62 173 if (this == o) return true;
universe@62 174 if (o == null || getClass() != o.getClass()) return false;
universe@62 175 Issue issue = (Issue) o;
universe@62 176 return id == issue.id;
universe@62 177 }
universe@62 178
universe@62 179 @Override
universe@62 180 public int hashCode() {
universe@62 181 return Objects.hash(id);
universe@62 182 }
universe@62 183 }

mercurial