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

seven.wapperInt.wapperRef.WrapperObj Maven / Gradle / Ivy

There is a newer version: 1.0.4
Show newest version
package seven.wapperInt.wapperRef;



//=======================================================
//		          .----.
//		       _.'__    `.
//		   .--(^)(^^)---/#\
//		 .' @          /###\
//		 :         ,   #####
//		  `-..__.-' _.-\###/
//		        `;_:    `"'
//		      .'"""""`.
//		     /,  ya ,\\
//		    //狗神保佑  \\
//		    `-._______.-'
//		    ___`. | .'___
//		   (______|______)
//=======================================================

import seven.callBack.DataFilterInterface;
import seven.callBack.DataFilterProcessInterface;
import seven.callBack.imp.DefaultDataFilter;
import seven.callBack.imp.DefaultDataProFilter;
import seven.config.Config;
import seven.wapperInt.Wrapper;

import java.util.*;
import java.util.function.Consumer;

/**
 * @author Seven

* date 2016年4月12日-下午4:07:57 */ @SuppressWarnings("all") public abstract class WrapperObj extends Wrapper { protected DataFilterInterface filter=new DefaultDataFilter(); protected DataFilterProcessInterface process=new DefaultDataProFilter(); protected List filterColByKey =new ArrayList<>(); protected List filterColByValue =new ArrayList<>(); protected Comparator c=null; protected String fs; protected static final boolean isMap=false; protected abstract T RefResWrapper(String fs, boolean isMap, String key) throws Exception; public WrapperObj(Consumer consumer) { super(consumer); } protected boolean isNull(Map map) { boolean isN = true; for (Map.Entry s : map.entrySet()) { isN = isN && s.getValue().trim().equals(""); } return isN; } @Override public Wrapper FilterCol(Consumer> consumer) { consumer.accept(filterColByKey); return this; } public Wrapper init(String filePath){ this.fs=filePath; return this; } public Wrapper Sort(Comparator c) { this.c = c;return this; } public List Create() throws Exception{ return RefResWrapper(fs,isMap,null); } @Override public List> CreateMap()throws Exception { return RefResWrapper(fs,isMap,null); } @Override public Map> CreateMap(String key) throws Exception { return RefResWrapper(fs,!isMap,key); } @Override public Wrapper Filter(DataFilterInterface filter) { this.filter = filter;return this; } @Override public Wrapper Process(DataFilterProcessInterface process) { this.process = process;return this; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy