RecipeContextValue.java

package com.mycim.valueobject.prp;

import com.mycim.framework.utils.lang.StringUtils;
import com.mycim.framework.utils.lang.math.NumberUtils;
import com.mycim.valueobject.consts.ContextNames;

/**
 * @author andy
 */
public class RecipeContextValue extends ContextValue {

    private static final long serialVersionUID = 1L;

    public RecipeContextValue() {
        this.setContextId(ContextNames.RECIPE_CONTEXT);
    }

    /**
     * @param contextRrn context id: {@value ContextNames#RECIPE_CONTEXT} RRN
     */
    public RecipeContextValue(long contextRrn) {
        super(contextRrn);
    }

    /**
     * @return the operationRrn
     */
    public Long getOperationRrn() {
        return NumberUtils.createLong(StringUtils.trimToNull(this.getContextKey1()));
    }

    /**
     * @param operationRrn the operationRrn to set
     */
    public void setOperationRrn(Long operationRrn) {
        this.setContextKey1(StringUtils.toString(operationRrn));
    }

    /**
     * @return the routeRrn
     */
    public Long getRouteRrn() {
        return NumberUtils.createLong(StringUtils.trimToNull(this.getContextKey2()));
    }

    /**
     * @param routeRrn the routeRrn to set
     */
    public void setRouteRrn(Long routeRrn) {
        this.setContextKey2(StringUtils.toString(routeRrn));
    }

    /**
     * @return the processRrn
     */
    public Long getProcessRrn() {
        return NumberUtils.createLong(StringUtils.trimToNull(this.getContextKey3()));
    }

    /**
     * @param processRrn the processRrn to set
     */
    public void setProcessRrn(Long processRrn) {
        this.setContextKey3(StringUtils.toString(processRrn));
    }

    /**
     * @return the productRrn
     */
    public Long getProductRrn() {
        return NumberUtils.createLong(StringUtils.trimToNull(this.getContextKey4()));
    }

    /**
     * @param productRrn the productRrn to set
     */
    public void setProductRrn(Long productRrn) {
        this.setContextKey4(StringUtils.toString(productRrn));
    }

    public Long getEquipmentModel() {
        return NumberUtils.createLong(StringUtils.trimToNull(this.getContextKey5()));
    }

    /**
     * @param equipmentModel the equipmentModel to set
     */
    public void setEquipmentModel(Long equipmentModel) {
        this.setContextKey5(StringUtils.toString(equipmentModel));
    }

    public Long getMainEqpt() {
        return NumberUtils.createLong(StringUtils.trimToNull(this.getContextKey6()));
    }

    /**
     * @param mainEqpt the mainEqpt to set
     */
    public void setMainEqpt(Long mainEqpt) {
        this.setContextKey6(StringUtils.toString(mainEqpt));
    }

    /**
     * @return the lotRrn
     */
    public Long getLotRrn() {
        return NumberUtils.createLong(StringUtils.trimToNull(this.getContextKey7()));
    }

    /**
     * @param lotRrn the lotRrn to set
     */
    public void setLotRrn(Long lotRrn) {
        this.setContextKey7(StringUtils.toString(lotRrn));
    }

    public String getProductLayer() {
        return this.getContextKey8();
    }

    public void setProductLayer(String productLayer) {
        this.setContextKey8(productLayer);
    }

    public String getRouteSeq() {
        return this.getContextKey9();
    }

    public void setRouteSeq(String routeSeq) {
        this.setContextKey9(routeSeq);
    }

    public void setOperationSeq(String operationSeq) {
        this.setContextKey10(operationSeq);
    }

    public String getOperationSeq() {
        return this.getContextKey10();
    }

    public Integer getProcessVersion() {
        return NumberUtils.toInt(StringUtils.trimToNull(this.getContextKey11()));
    }

    public void setProcessVersion(Integer processVersion) {
        this.setContextKey11(StringUtils.toString(processVersion));
    }

    /**
     * @return the productVersion
     */
    public Integer getProductVersion() {
        return NumberUtils.createInteger(StringUtils.trimToNull(this.getContextKey12()));
    }

    /**
     * @param productVersion the productVersion to set
     */
    public void setProductVersion(Integer productVersion) {
        this.setContextKey12(StringUtils.toString(productVersion));
    }

    public String getActionType() {
        return getContextKey15();
    }

    public void setActionType(String actionType) {
        this.setContextKey15(actionType);
    }

    /**
     * resultValue1
     *
     * @return the recipeRrn
     */
    public Long getRecipeRrn() {
        return NumberUtils.createLong(StringUtils.trimToNull(this.getResultValue1()));
    }

    /**
     * @param recipeRrn the recipeRrn to set
     */
    public void setRecipeRrn(Long recipeRrn) {
        this.setResultValue1(StringUtils.toString(recipeRrn));
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     *
     * @return result value 2
     * @deprecated 不知道从什么时候被启用/弃用
     */
    @Deprecated
    public String getParameter() {
        return this.getResultValue2();
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     *
     * @param parameter parameter
     * @deprecated 不知道从什么时候被启用/弃用
     */
    @Deprecated
    public void setParameter(String parameter) {
        if (StringUtils.isNotEmpty(parameter)) {
            this.setResultValue2(parameter);
        }
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     *
     * @return result value 3
     * @deprecated 不知道从什么时候被启用/弃用,Yield 与 Frequency 冲突
     */
    @Deprecated
    public long getFrequency() {
        return NumberUtils.toLong(this.getResultValue3());
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     *
     * @return result value 3
     * @deprecated 不知道从什么时候被启用/弃用,Yield 与 Frequency 冲突
     */
    @Deprecated
    public String getYield() {
        return this.getResultValue3();
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     *
     * @param yield yield
     * @deprecated 不知道从什么时候被启用/弃用,Yield 与 Frequency 冲突
     */
    @Deprecated
    public void setYield(String yield) {
        if (StringUtils.isNotEmpty(yield)) {
            if (yield.indexOf("%") == -1) {
                yield = yield + "%";
            }
            this.setResultValue3(yield);
        }
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     *
     * @return result value 4
     * @deprecated 不知道从什么时候被启用/弃用,CheckUnit 与 SamplingRate 冲突
     */
    @Deprecated
    public String getCheckUnit() {
        return this.getResultValue4();
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     * TODO CheckUnit 与 SamplingRate 冲突
     *
     * @return result value 4
     * @deprecated 不知道从什么时候被启用/弃用,CheckUnit 与 SamplingRate 冲突
     */
    public String getSamplingRate() {
        return this.getResultValue4();
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     *
     * @param samplingRate sampling rates
     * @deprecated 不知道从什么时候被启用/弃用,CheckUnit 与 SamplingRate 冲突
     */
    @Deprecated
    public void setSamplingRate(String samplingRate) {
        if (StringUtils.isNotEmpty(samplingRate)) {
            this.setResultValue4(samplingRate);
        }
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     *
     * @return result value 5
     * @deprecated 不知道从什么时候被启用/弃用,BOM RRN 与 Wiring RRN 冲突
     */
    @Deprecated
    public String getBomRrn() {
        return this.getResultValue5();
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     *
     * @param bomRrn BOM RRN
     * @deprecated 不知道从什么时候被启用/弃用,BOM RRN 与 Wiring RRN 冲突
     */
    @Deprecated
    public void setBomRrn(Long bomRrn) {
        if (bomRrn != null) {
            this.setResultValue5(bomRrn + "");
        }
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     *
     * @return result value 5
     * @deprecated 不知道从什么时候被启用/弃用,BOM RRN 与 Wiring RRN 冲突
     */
    @Deprecated
    public Long getWiringRrn() {
        return NumberUtils.createLong(StringUtils.trimToNull(this.getResultValue5()));
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     *
     * @param wiringRrn Wiring RRN
     * @deprecated 不知道从什么时候被启用/弃用,BOM RRN 与 Wiring RRN 冲突
     */
    @Deprecated
    public void setWiringRrn(Long wiringRrn) {
        if (wiringRrn != null) {
            this.setResultValue5(wiringRrn + "");
        }
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     *
     * @return result value 6
     * @deprecated 不知道从什么时候被启用/弃用,
     */
    @Deprecated
    public String getTimeOutAction() {
        return this.getResultValue6();
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     *
     * @param timeOutAction time out action
     * @deprecated 不知道从什么时候被启用/弃用,
     */
    @Deprecated
    public void setTimeOutAction(String timeOutAction) {
        this.setResultValue6(timeOutAction);
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     *
     * @return tail code
     * @deprecated 不知道从什么时候被启用/弃用,
     */
    @Deprecated
    public String getTailCode() {
        return this.getResultValue7();
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     *
     * @param tailCode
     * @deprecated 不知道从什么时候被启用/弃用,
     */
    @Deprecated
    public void setTailCode(String tailCode) {
        if (StringUtils.isNotEmpty(tailCode)) {
            this.setResultValue7(tailCode);
        }

    }

    public Long getAttributeNameRrn() {
        return NumberUtils.createLong(StringUtils.trimToNull(this.getResultValue8()));
    }

    public void setAttributeNameRrn(Long attributeNameRrn) {
        this.setResultValue8(StringUtils.toString(attributeNameRrn));
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     *
     * @return result value 10
     * @deprecated 不知道从什么时候被启用/弃用,
     */
    @Deprecated
    public long getLastUsedTime() {
        return NumberUtils.toLong(this.getResultValue10());
    }

    /**
     * 不应该直接使用,需确认业务逻辑。
     *
     * @param lastUsedTime last used time
     * @deprecated 不知道从什么时候被启用/弃用,
     */
    @Deprecated
    public void setLastUsedTime(long lastUsedTime) {
        this.setResultValue10(lastUsedTime + "");
    }

}