| 1 |
|
package com.atlassian.core.bean; |
| 2 |
|
|
| 3 |
|
import com.atlassian.core.util.Clock; |
| 4 |
|
|
| 5 |
|
import java.util.Date; |
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
|
|
|
| 51.2% |
Uncovered Elements: 20 (41) |
Complexity: 15 |
Complexity Density: 0.75 |
|
| 11 |
|
public class EntityObject implements Cloneable |
| 12 |
|
{ |
| 13 |
|
private long id = 0; |
| 14 |
|
private Date creationDate; |
| 15 |
|
private Date lastModificationDate; |
| 16 |
|
|
| 17 |
|
private Clock clock; |
| 18 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 19 |
3
|
public long getId()... |
| 20 |
|
{ |
| 21 |
3
|
return id; |
| 22 |
|
} |
| 23 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 24 |
3
|
public void setId(long id)... |
| 25 |
|
{ |
| 26 |
3
|
this.id = id; |
| 27 |
|
} |
| 28 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 29 |
0
|
public Date getCreationDate()... |
| 30 |
|
{ |
| 31 |
0
|
return creationDate; |
| 32 |
|
} |
| 33 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 34 |
0
|
public void setCreationDate(Date creationDate)... |
| 35 |
|
{ |
| 36 |
0
|
this.creationDate = creationDate; |
| 37 |
|
} |
| 38 |
|
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 1 |
|
| 39 |
0
|
public Date getLastModificationDate()... |
| 40 |
|
{ |
| 41 |
0
|
return lastModificationDate != null ? lastModificationDate : creationDate; |
| 42 |
|
} |
| 43 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 44 |
0
|
public void setLastModificationDate(Date lastModificationDate)... |
| 45 |
|
{ |
| 46 |
0
|
this.lastModificationDate = lastModificationDate; |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
|
| 50 |
|
|
| 51 |
|
|
| 52 |
|
|
| 53 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 54 |
0
|
public void setClock(Clock clock)... |
| 55 |
|
{ |
| 56 |
0
|
this.clock = clock; |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
|
| 60 |
|
|
| 61 |
|
|
| 62 |
|
@return |
| 63 |
|
|
| 64 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 65 |
0
|
public Date getCurrentDate()... |
| 66 |
|
{ |
| 67 |
0
|
if (clock != null) |
| 68 |
0
|
return clock.getCurrentDate(); |
| 69 |
|
|
| 70 |
0
|
return new Date(); |
| 71 |
|
} |
| 72 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 73 |
4
|
public int hashCode()... |
| 74 |
|
{ |
| 75 |
4
|
return (int) (id ^ (id >>> 32)); |
| 76 |
|
} |
| 77 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 4 |
Complexity Density: 0.5 |
|
| 78 |
5
|
public boolean equals(Object o)... |
| 79 |
|
{ |
| 80 |
5
|
if (this == o) return true; |
| 81 |
4
|
if (!(o instanceof EntityObject)) return false; |
| 82 |
|
|
| 83 |
3
|
final EntityObject entityObject = (EntityObject) o; |
| 84 |
|
|
| 85 |
3
|
if (id != entityObject.getId()) return false; |
| 86 |
|
|
| 87 |
2
|
return true; |
| 88 |
|
} |
| 89 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 90 |
0
|
public Object clone() throws CloneNotSupportedException... |
| 91 |
|
{ |
| 92 |
0
|
return super.clone(); |
| 93 |
|
} |
| 94 |
|
} |