Advertisement
Guest User

Issue

a guest
Mar 28th, 2015
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.28 KB | None | 0 0
  1. package fr.bluebird.report;
  2.  
  3. import java.util.ArrayList;
  4.  
  5. public class Issue {
  6.  
  7.     private static ArrayList<Issue> allIsues = new ArrayList<Issue>();
  8.  
  9.     private final String user;
  10.     private final String description;
  11.  
  12.     private final String reporter;
  13.  
  14.     private IssueStatus status = IssueStatus.valueOf(0);
  15.  
  16.     public Issue(String user, String description, String reporter) {
  17.         this.user = user;
  18.         this.description = description;
  19.         this.reporter = reporter;
  20.  
  21.         allIsues.add(this);
  22.     }
  23.  
  24.     public Issue(String user, String description, String reporter, int status) {
  25.         this.user = user;
  26.         this.description = description;
  27.         this.reporter = reporter;
  28.         this.status = IssueStatus.valueOf(status);
  29.  
  30.         allIsues.add(this);
  31.     }
  32.  
  33.     public static ArrayList<Issue> getAllIsues() {
  34.         return allIsues;
  35.     }
  36.  
  37.     public static ArrayList<Issue> getAllIsuesBy(String user) {
  38.         ArrayList<Issue> list = new ArrayList<Issue>();
  39.         for(Issue issue : allIsues)
  40.             if(issue.getReporter().equalsIgnoreCase(user))
  41.                 list.add(issue);
  42.         return list;
  43.     }
  44.  
  45.     public String getUser() {
  46.         return user;
  47.     }
  48.  
  49.     public String getDescription() {
  50.         return description;
  51.     }
  52.  
  53.     public String getReporter() {
  54.         return reporter;
  55.     }
  56.  
  57.     public IssueStatus getStatus() {
  58.         return status;
  59.     }
  60.  
  61.     public void save() {
  62.  
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement