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

gu.sql2java.ColumnGetter Maven / Gradle / Ivy

There is a newer version: 5.2.0
Show newest version
package gu.sql2java;

import com.google.common.base.Function;

public class ColumnGetter implements Function{
	private final int columnId;
	private final String columnName;
	public ColumnGetter(int columnId) {
		this.columnId = columnId;
		this.columnName = null;
	}
	public ColumnGetter(String columnName) {
		this.columnId = -1;
		this.columnName = columnName;
	}
	@Override
	public T apply(BaseBean input) {
		if(null != input){
			if(columnId >= 0){
				return input.getValue(columnId);
			}else if(columnName != null){
				return input.getValue(columnName);
			}
		}
		return null;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy