// Path: src/main/java/com/baidu/unbiz/multitask/exception/TaskBizException.java
// public class TaskBizException extends RuntimeException {
// 
//     private static final long serialVersionUID = -7375423850222016116L;
// 
//     public TaskBizException(String msg) {
//         super(msg);
//     }
// 
//     public TaskBizException(Throwable cause) {
//         super(cause);
//     }
// 
//     public TaskBizException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


import com.baidu.unbiz.multitask.exception.TaskBizException;
package com.baidu.unbiz.multitask.task;


/**
 * TaskBean执行参数辅助类
 *
 * Created by baidu on 15/12/24.
 */
public class Params {

    private Object[] params;
    private int cursor = 0;

    private Params(int paramLength) {
        if (paramLength < 2) {
            throw new TaskBizException(String.format("worng params length:%s", paramLength));
        }
        params = new Object[paramLength];
    }

    public <T> Params add(T param) {
        params[cursor] = (Object) param;
// Path: src/main/java/com/baidu/unbiz/multitask/exception/TaskBizException.java
// public class TaskBizException extends RuntimeException {
// 
//     private static final long serialVersionUID = -7375423850222016116L;
// 
//     public TaskBizException(String msg) {
//         super(msg);
//     }
// 
//     public TaskBizException(Throwable cause) {
//         super(cause);
//     }
// 
//     public TaskBizException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


// Path: src/main/java/com/baidu/unbiz/multitask/task/Params.java
import com.baidu.unbiz.multitask.exception.TaskBizException;

package com.baidu.unbiz.multitask.task;


/**
 * TaskBean执行参数辅助类
 *
 * Created by baidu on 15/12/24.
 */
public class Params {

    private Object[] params;
    private int cursor = 0;

    private Params(int paramLength) {
        if (paramLength < 2) {
            throw new TaskBizException(String.format("worng params length:%s", paramLength));
        }
        params = new Object[paramLength];
    }

    public <T> Params add(T param) {
        params[cursor] = (Object) param;
        cursor++;