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

com.github.azbh111.utils.java.csv.CsvColumnDefine Maven / Gradle / Ivy

The newest version!
package com.github.azbh111.utils.java.csv;

import lombok.*;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.function.Function;

/**
 * @author: zyp
 * @date: 2020/12/4 17:54
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder(toBuilder = true)
@ToString(callSuper = true)
class CsvColumnDefine {
    private String name;
    private int order;
    private Field field;
    private Method method;
    private Function conventor;
    private String nullValue;

    public Object get(Object item) throws InvocationTargetException, IllegalAccessException {
        if (method != null) {
            return method.invoke(item);
        }
        return field.get(item);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy