private static byte[] typeConvert(MappingConfig.ColumnItem columnItem, MappingConfig.HbaseMapping hbaseMapping,
                                      Object value) {
        if (value == null) {
            return null;
        }
        byte[] bytes = null;
        if (columnItem == null || columnItem.getType() == null || "".equals(columnItem.getType())) {
            if (MappingConfig.Mode.STRING == hbaseMapping.getMode()) {
                bytes = Bytes.toBytes(value.toString());
            } else if (MappingConfig.Mode.NATIVE == hbaseMapping.getMode()) {
                bytes = TypeUtil.toBytes(value);
            } else if (MappingConfig.Mode.PHOENIX == hbaseMapping.getMode()) {
                PhType phType = PhType.getType(value.getClass());
                bytes = PhTypeUtil.toBytes(value, phType);
            }
        } else {
            if (hbaseMapping.getMode() == MappingConfig.Mode.STRING) {
                bytes = Bytes.toBytes(value.toString());
            } else if (hbaseMapping.getMode() == MappingConfig.Mode.NATIVE) {
                Type type = Type.getType(columnItem.getType());
                bytes = TypeUtil.toBytes(value, type);
            } else if (hbaseMapping.getMode() == MappingConfig.Mode.PHOENIX) {
                PhType phType = PhType.getType(columnItem.getType());
                bytes = PhTypeUtil.toBytes(value, phType);
            }
        }
        return bytes;
    }
private static byte [ ] typeConvert ( MappingConfig . ColumnItem columnItem , MappingConfig . HbaseMapping hbaseMapping , Object value ) { if ( value == null ) { return null ; } byte [ ] bytes = null ; if ( columnItem == null || columnItem . getType ( ) == null || "" . equals ( columnItem . getType ( ) ) ) { if ( MappingConfig . Mode . STRING == hbaseMapping . getMode ( ) ) { bytes = Bytes . toBytes ( value . toString ( ) ) ; } else if ( MappingConfig . Mode . NATIVE == hbaseMapping . getMode ( ) ) { bytes = TypeUtil . toBytes ( value ) ; } else if ( MappingConfig . Mode . PHOENIX == hbaseMapping . getMode ( ) ) { PhType phType = PhType . getType ( value . getClass ( ) ) ; bytes = PhTypeUtil . toBytes ( value , phType ) ; } } else { if ( hbaseMapping . getMode ( ) == MappingConfig . Mode . STRING ) { bytes = Bytes . toBytes ( value . toString ( ) ) ; } else if ( hbaseMapping . getMode ( ) == MappingConfig . Mode . NATIVE ) { Type type = Type . getType ( columnItem . getType ( ) ) ; bytes = TypeUtil . toBytes ( value , type ) ; } else if ( hbaseMapping . getMode ( ) == MappingConfig . Mode . PHOENIX ) { PhType phType = PhType . getType ( columnItem . getType ( ) ) ; bytes = PhTypeUtil . toBytes ( value , phType ) ; } } return bytes ; }
根据对应的类型进行转换

@param columnItem 列项配置
@param hbaseMapping hbase映射配置
@param value 值
@return 复合字段rowKey