All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.datalking.common.convert.ConversionService Maven / Gradle / Ivy

The newest version!
package com.github.datalking.common.convert;

import com.github.datalking.common.convert.descriptor.TypeDescriptor;

/**
 * 数据类型转换 接口
 *
 * @author yaoo on 5/4/18
 */
public interface ConversionService {

    // 判断是否可以将一个Java类转换为另一个Java类
    boolean canConvert(Class sourceType, Class targetType);

    // 将源类型对象转换为目标类型对象
     T convert(Object source, Class targetType);

    Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType);

    boolean canConvert(TypeDescriptor sourceType, TypeDescriptor targetType);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy