TestBundleDiag with configurable await logging
[odlparent.git] / bundles-test-lib / src / main / java / org / opendaylight / odlparent / bundlestest / lib / TimeInfo.java
1 /*
2  * Copyright (c) 2017 Red Hat, Inc. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.odlparent.bundlestest.lib;
9
10 /**
11  * Value Object for elapsed and remaining time.
12  *
13  * @author Michael Vorburger.ch
14  */
15 public class TimeInfo {
16
17     private final long elapsedTimeInMS;
18     private final long remainingTimeInMS;
19
20     public TimeInfo(long elapsedTimeInMS, long remainingTimeInMS) {
21         this.elapsedTimeInMS = elapsedTimeInMS;
22         this.remainingTimeInMS = remainingTimeInMS;
23     }
24
25     public long getElapsedTimeInMS() {
26         return elapsedTimeInMS;
27     }
28
29     public long getRemainingTimeInMS() {
30         return remainingTimeInMS;
31     }
32
33     @Override
34     public int hashCode() {
35         final int prime = 31;
36         int result = 1;
37         result = prime * result + (int) (elapsedTimeInMS ^ elapsedTimeInMS >>> 32);
38         result = prime * result + (int) (remainingTimeInMS ^ remainingTimeInMS >>> 32);
39         return result;
40     }
41
42     @Override
43     public boolean equals(Object obj) {
44         if (this == obj) {
45             return true;
46         }
47         if (obj == null) {
48             return false;
49         }
50         if (!(obj instanceof TimeInfo)) {
51             return false;
52         }
53         TimeInfo other = (TimeInfo) obj;
54         if (elapsedTimeInMS != other.elapsedTimeInMS) {
55             return false;
56         }
57         if (remainingTimeInMS != other.remainingTimeInMS) {
58             return false;
59         }
60         return true;
61     }
62
63     @Override
64     public String toString() {
65         return "TimeInfo [elapsedTimeInMS=" + elapsedTimeInMS + ", remainingTimeInMS=" + remainingTimeInMS + "]";
66     }
67
68 }