| 1 | package org.bouncycastle.kmip.wire; |
| 2 | |
| 3 | public class KMIPInterval |
| 4 | implements KMIPItem |
| 5 | { |
| 6 | private final int tag; |
| 7 | private final long value; |
| 8 | |
| 9 | public KMIPInterval(int tag, long value) |
| 10 | { |
| 11 | if (value > 0xffffffffL || value < 0) |
| 12 | { |
| 13 | throw new IllegalArgumentException("interval value out of range"); |
| 14 | } |
| 15 | |
| 16 | this.tag = tag; |
| 17 | this.value = value; |
| 18 | } |
| 19 | |
| 20 | public int getTag() |
| 21 | { |
| 22 | return tag; |
| 23 | } |
| 24 | |
| 25 | public byte getType() |
| 26 | { |
| 27 | return KMIPType.INTERVAL; |
| 28 | } |
| 29 | |
| 30 | public long getLength() |
| 31 | { |
| 32 | return 4; |
| 33 | } |
| 34 | |
| 35 | public Object getValue() |
| 36 | { |
| 37 | return new Long(value); |
| 38 | } |
| 39 | |
| 40 | public KMIPItem toKMIPItem() |
| 41 | { |
| 42 | return this; |
| 43 | } |
| 44 | } |
nothing calls this directly
no outgoing calls
no test coverage detected