1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.seasar.cubby.converter.impl;
17
18 import java.math.BigInteger;
19
20
21
22
23
24
25 public class ByteConverter extends AbstractIntegerNumberConverter {
26
27
28 private static final BigInteger MIN_VALUE = BigInteger
29 .valueOf(Byte.MIN_VALUE);
30
31
32 private static final BigInteger MAX_VALUE = BigInteger
33 .valueOf(Byte.MAX_VALUE);
34
35
36
37
38 public Class<?> getObjectType() {
39 return Byte.class;
40 }
41
42
43
44
45 @Override
46 protected Number convert(final BigInteger decimal) {
47 return Byte.valueOf(decimal.byteValue());
48 }
49
50
51
52
53 @Override
54 protected BigInteger getMinValue() {
55 return MIN_VALUE;
56 }
57
58
59
60
61 @Override
62 protected BigInteger getMaxValue() {
63 return MAX_VALUE;
64 }
65
66 }