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

com.cudrania.core.pipeline.PipelineContext Maven / Gradle / Ivy

There is a newer version: 1.2.7
Show newest version
package com.cudrania.core.pipeline;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * pipeline上下文,用于存取执行结果
 */
public class PipelineContext {

    private Map store = new HashMap<>();
    @Getter
    private Object[] last;
    @Getter
    private Object[] first;

    public void setLast(Object[] last) {
        this.last = last;
    }

    /**
     * 设置初始数据
     *
     * @param first
     */
    public void setFirst(Object[] first) {
        this.first = first;
        this.last = first;
    }


    /**
     * 保存数据
     *
     * @param name
     * @param value
     */
    public void put(String name, Object value) {
        store.put(name, value);
    }

    /**
     * 是否包含指定数据
     *
     * @param name
     * @return
     */
    public boolean has(String name) {
        return store.containsKey(name);
    }

    /**
     * 获取指定数据
     *
     * @param name
     * @return
     */
    public Object get(String name) {
        return store.get(name);
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy