Skip to main content
summaryrefslogtreecommitdiffstats
blob: 5f20d4441728520d7e1146241c7592afb96e0f32 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*******************************************************************************
 * Copyright (c) 2013 Boeing.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Boeing - initial API and implementation
 *******************************************************************************/
package org.eclipse.osee.ats.core.mock;

import java.util.LinkedList;
import java.util.List;
import org.eclipse.osee.ats.api.user.IAtsUser;

/**
 * @author Donald G. Dunne
 */
public class MockState {

   private final String name;
   private final List<IAtsUser> assignees = new LinkedList<IAtsUser>();
   private double hoursSpent = 0;
   private int percentComplete = 0;

   public MockState(String name, List<? extends IAtsUser> assignees) {
      this(name, assignees, 0, 0);
   }

   public MockState(String name, List<? extends IAtsUser> assignees, double hoursSpent, int percentComplete) {
      this.name = name;
      this.assignees.addAll(assignees);
      this.hoursSpent = hoursSpent;
      this.percentComplete = percentComplete;
   }

   public void setHoursSpent(double hoursSpent) {
      this.hoursSpent = hoursSpent;
   }

   public void setPercentComplete(int percentComplete) {
      this.percentComplete = percentComplete;
   }

   public MockState(String name) {
      this.name = name;
   }

   public String getName() {
      return name;
   }

   public List<IAtsUser> getAssignees() {
      return assignees;
   }

   public double getHoursSpent() {
      return hoursSpent;
   }

   public int getPercentComplete() {
      return percentComplete;
   }

   public void addAssignee(IAtsUser steve) {
      if (!assignees.contains(steve)) {
         assignees.add(steve);
      }
   }

   public void setAssignees(List<? extends IAtsUser> users) {
      assignees.clear();
      assignees.addAll(users);
   }

}

Back to the top