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

Mon, 18 May 2020 21:05:57 +0200

author
Mike Becker <universe@uap-core.de>
date
Mon, 18 May 2020 21:05:57 +0200
changeset 62
833e0385572a
child 75
33b6843fdf8a
permissions
-rw-r--r--

adds data model for issues

     1 /*
     2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     3  *
     4  * Copyright 2018 Mike Becker. All rights reserved.
     5  *
     6  * Redistribution and use in source and binary forms, with or without
     7  * modification, are permitted provided that the following conditions are met:
     8  *
     9  *   1. Redistributions of source code must retain the above copyright
    10  *      notice, this list of conditions and the following disclaimer.
    11  *
    12  *   2. Redistributions in binary form must reproduce the above copyright
    13  *      notice, this list of conditions and the following disclaimer in the
    14  *      documentation and/or other materials provided with the distribution.
    15  *
    16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    17  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    19  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
    20  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    26  * POSSIBILITY OF SUCH DAMAGE.
    27  *
    28  */
    29 package de.uapcore.lightpit.entities;
    31 import java.sql.Date;
    32 import java.sql.Timestamp;
    33 import java.util.List;
    34 import java.util.Objects;
    36 public final class Issue {
    38     private final int id;
    39     private final Project project;
    41     private IssueStatus status;
    42     private IssueCategory category;
    44     private String subject;
    45     private String description;
    47     private List<Version> affectedVersions;
    48     private Version scheduledVersion;
    49     private Version resolvedVersion;
    51     private Timestamp created;
    52     private Timestamp updated;
    53     private Date eta;
    55     public Issue(int id, Project project) {
    56         this.id = id;
    57         this.project = project;
    58     }
    60     public int getId() {
    61         return id;
    62     }
    64     public Project getProject() {
    65         return project;
    66     }
    68     public IssueStatus getStatus() {
    69         return status;
    70     }
    72     public void setStatus(IssueStatus status) {
    73         this.status = status;
    74     }
    76     public IssueCategory getCategory() {
    77         return category;
    78     }
    80     public void setCategory(IssueCategory category) {
    81         this.category = category;
    82     }
    84     public String getSubject() {
    85         return subject;
    86     }
    88     public void setSubject(String subject) {
    89         this.subject = subject;
    90     }
    92     public String getDescription() {
    93         return description;
    94     }
    96     public void setDescription(String description) {
    97         this.description = description;
    98     }
   100     public List<Version> getAffectedVersions() {
   101         return affectedVersions;
   102     }
   104     public void setAffectedVersions(List<Version> affectedVersions) {
   105         this.affectedVersions = affectedVersions;
   106     }
   108     public Version getScheduledVersion() {
   109         return scheduledVersion;
   110     }
   112     public void setScheduledVersion(Version scheduledVersion) {
   113         this.scheduledVersion = scheduledVersion;
   114     }
   116     public Version getResolvedVersion() {
   117         return resolvedVersion;
   118     }
   120     public void setResolvedVersion(Version resolvedVersion) {
   121         this.resolvedVersion = resolvedVersion;
   122     }
   124     public Timestamp getCreated() {
   125         return created;
   126     }
   128     public void setCreated(Timestamp created) {
   129         this.created = created;
   130     }
   132     public Timestamp getUpdated() {
   133         return updated;
   134     }
   136     public void setUpdated(Timestamp updated) {
   137         this.updated = updated;
   138     }
   140     public Date getEta() {
   141         return eta;
   142     }
   144     public void setEta(Date eta) {
   145         this.eta = eta;
   146     }
   148     @Override
   149     public boolean equals(Object o) {
   150         if (this == o) return true;
   151         if (o == null || getClass() != o.getClass()) return false;
   152         Issue issue = (Issue) o;
   153         return id == issue.id;
   154     }
   156     @Override
   157     public int hashCode() {
   158         return Objects.hash(id);
   159     }
   160 }

mercurial