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

com.github.fengxxc.write.PropMapper Maven / Gradle / Ivy

package com.github.fengxxc.write;

import com.github.fengxxc.ElementMapper;
import com.github.fengxxc.model.Point;
import org.apache.poi.ss.util.CellReference;

/**
 * @author fengxxc
 */
public class PropMapper extends ElementMapper {
    private Object defVal;

    public PropMapper() {
    }

    public static  PropMapper of(Point point) {
        PropMapper propMapper = new PropMapper<>();
        propMapper.setPoint(point);
        return propMapper;
    }

    public static  PropMapper of(int y, int x) {
        return of(Point.of(y, x));
    }

    public static  PropMapper of(String colRef, int rowRef) {
        final int x = CellReference.convertColStringToIndex(colRef);
        return of(rowRef - 1, x);
    }

    public static  PropMapper of(String cellRef) {
        final Point point = Point.of(cellRef);
        return of(point);
    }

    public static  PropMapper reOf(PropMapper propMapper) {
        PropMapper reMapper = new PropMapper<>();
        reMapper.setParentId(propMapper.getParentId());
        reMapper.setPoint(propMapper.getPoint());
        return reMapper;
    }

    public Object getDefVal() {
        return defVal;
    }

    public PropMapper setDefVal(Object defVal) {
        this.defVal = defVal;
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy