]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc/src/main/java/org/argeo/slc/core/test/NumericTRId.java
Improve error logging and reporting
[gpl/argeo-slc.git] / org.argeo.slc / 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 public class NumericTRId implements TestResultId {
10 /** For ORM */
11 private Long tid;
12
13 private Long value;
14 private DeployedSystemId deployedSystemId;
15
16 /**
17 * Initializes the long value with the current time (based on
18 * <code>java.lang.System.currentTimeMillis()</code>).
19 */
20 public void init() {
21 if (getValue() == null) {
22 setValue(System.currentTimeMillis());
23 }
24 }
25
26 public Long getValue() {
27 return value;
28 }
29
30 public void setValue(Long value) {
31 this.value = value;
32 }
33
34 public DeployedSystemId getDeployedSystemId() {
35 return deployedSystemId;
36 }
37
38 public void setDeployedSystemId(DeployedSystemId deployedSystemId) {
39 this.deployedSystemId = deployedSystemId;
40 }
41
42 @Override
43 public boolean equals(Object obj) {
44 return value.toString().equals(obj.toString());
45 }
46
47 @Override
48 public String toString() {
49 return value.toString();
50 }
51
52 Long getTid() {
53 return tid;
54 }
55
56 void setTid(Long tid) {
57 this.tid = tid;
58 }
59
60 }