]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/NumericTRId.java
Replace test result id by UUID
[gpl/argeo-slc.git] / org.argeo.slc.core / src / main / java / org / argeo / slc / core / test / NumericTRId.java
1 package org.argeo.slc.core.test;
2
3 import org.argeo.slc.core.deploy.DeployedSystemId;
4
5 /**
6 * Basic implementation of test run id based on a long value and a reference to
7 * a deployed system id.
8 *
9 * @deprecated
10 */
11 public class NumericTRId implements TestResultId {
12 /** For ORM */
13 private Long tid;
14
15 private Long value;
16 private DeployedSystemId deployedSystemId;
17
18 /** For ORM */
19 public NumericTRId() {
20
21 }
22
23 public NumericTRId(Long value) {
24 this.value = value;
25 }
26
27 /**
28 * Initializes the long value with the current time (based on
29 * <code>java.lang.System.currentTimeMillis()</code>).
30 */
31 public void init() {
32 if (getValue() == null) {
33 setValue(System.currentTimeMillis());
34 }
35 }
36
37 public Long getValue() {
38 return value;
39 }
40
41 public void setValue(Long value) {
42 this.value = value;
43 }
44
45 public DeployedSystemId getDeployedSystemId() {
46 return deployedSystemId;
47 }
48
49 public void setDeployedSystemId(DeployedSystemId deployedSystemId) {
50 this.deployedSystemId = deployedSystemId;
51 }
52
53 @Override
54 public boolean equals(Object obj) {
55 return value.toString().equals(obj.toString());
56 }
57
58 @Override
59 public String toString() {
60 return value.toString();
61 }
62
63 Long getTid() {
64 return tid;
65 }
66
67 void setTid(Long tid) {
68 this.tid = tid;
69 }
70
71 }