![JAR search and dependency download from the Maven repository](/logo.png)
com.alibaba.tamper.core.helper.BatchObjectHolder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tamper Show documentation
Show all versions of tamper Show documentation
github tamper project as open source.
The newest version!
package com.alibaba.tamper.core.helper;
import com.alibaba.tamper.core.BeanMappingException;
/**
* 批量处理对象的holder处理
*
* @author jianghang 2011-6-2 下午12:44:26
*/
public class BatchObjectHolder {
private Object[] batchValues = null;
private int currentIndex;
public void setBatchValues(Object[] batchValues) {
this.batchValues = batchValues;
}
public BatchObjectHolder(Object[] values){
if (values == null) {
throw new BeanMappingException("batch values is null!");
}
this.batchValues = values;
this.currentIndex = -1;
}
public Object[] getBatchValues() {
return batchValues;
}
public Object getNext() {
currentIndex = currentIndex + 1;
if (currentIndex > batchValues.length) {
throw new BeanMappingException("batch values index is out of Array!");
}
return batchValues[currentIndex];
}
public void setObject(Object value) {
batchValues[currentIndex] = value;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy