class IntegerType implements Type<IntegerHolder> {

    @Override
    public IntegerHolder convert(Object obj) {
        if (obj instanceof Long || obj instanceof Integer || obj instanceof Short || obj instanceof Byte) {
            Number n = (Number) obj;
            return new IntegerHolder(n.longValue());
        }

        if (obj == null) {
            return new IntegerHolder(null);
        }

        if (obj instanceof String) {
            return decode((String) obj);
        }

        throw new IllegalArgumentException("conversion not supported for: " + obj.getClass());
    }

}