| 3 | import java.util.Date; |
| 4 | |
| 5 | public class KMIPDateTime |
| 6 | implements KMIPItem |
| 7 | { |
| 8 | private final int tag; |
| 9 | private final long value; |
| 10 | |
| 11 | public KMIPDateTime(int tag, Date value) |
| 12 | { |
| 13 | this.tag = tag; |
| 14 | this.value = value.getTime(); |
| 15 | } |
| 16 | |
| 17 | public int getTag() |
| 18 | { |
| 19 | return tag; |
| 20 | } |
| 21 | |
| 22 | public byte getType() |
| 23 | { |
| 24 | return KMIPType.DATE_TIME; |
| 25 | } |
| 26 | |
| 27 | public long getLength() |
| 28 | { |
| 29 | return 8; |
| 30 | } |
| 31 | |
| 32 | public Object getValue() |
| 33 | { |
| 34 | return new Date(value); |
| 35 | } |
| 36 | |
| 37 | public KMIPItem toKMIPItem() |
| 38 | { |
| 39 | return this; |
| 40 | } |
| 41 | } |
nothing calls this directly
no outgoing calls
no test coverage detected