LotRecycledContextValue.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;

/**
 * <pre>
 * contextKey1 -> PROCESS
 * contextKey2 -> start ROUTE
 * contextKey3 -> start OPERATION
 * contextKey4 -> end ROUTE
 * contextKey5 -> end OPERATION
 * contextKey6 -> FLD_PROCESS_VERSION
 * </pre>
 *
 * <pre>
 * resultValue1 -> FLD_PROCESS_LOOP
 * </pre>
 *
 * @author mark
 */
public class LotRecycledContextValue extends AbstractContextValue {


    /**
     *
     */
    private static final long serialVersionUID = 1L;

    public LotRecycledContextValue() {
        this.setContextId(ContextNames.LOT_RECYCLED_CONTEXT);
    }

    public LotRecycledContextValue(long contextRrn) {
        super(contextRrn);
    }

    /**
     * contextKey1
     */
    @java.lang.Override
    public Long getProcessRrn() {
        return NumberUtils.createLong(StringUtils.trimToNull(this.getContextKey1()));
    }

    /**
     * contextKey1
     */
    @java.lang.Override
    public void setProcessRrn(Long processRrn) {
        if (processRrn != null) {
            this.setContextKey1(StringUtils.toString(processRrn));
        }
    }

    /**
     * contextKey2
     *
     * @return
     */
    public Long getStartRouteRrn() {
        return NumberUtils.createLong(StringUtils.trimToNull(this.getResultValue2()));
    }

    /**
     * contextKey2
     *
     * @param routeRrn
     */
    public void setStartRouteRrn(Long routeRrn) {
        if (routeRrn != null) {
            this.setContextKey2(StringUtils.toString(routeRrn));
            this.setResultValue2(StringUtils.toString(routeRrn));
        }
    }

    /**
     * contextKey3
     *
     * @return
     */
    public Long getStartOperationRrn() {
        return NumberUtils.createLong(StringUtils.trimToNull(this.getResultValue3()));
    }


    /**
     * contextKey3
     *
     * @param operationRrn
     */
    public void setStartOperationRrn(Long operationRrn) {
        if (operationRrn != null) {
            this.setContextKey3(StringUtils.toString(operationRrn));
            this.setResultValue3(StringUtils.toString(operationRrn));
        }
    }

    /**
     * contextKey4
     *
     * @return
     */
    public Long getEndRouteRrn() {
        return NumberUtils.createLong(StringUtils.trimToNull(this.getContextKey4()));
    }

    /**
     * contextKey4
     *
     * @param routeRrn
     */
    public void setEndRouteRrn(Long routeRrn) {
        if (routeRrn != null) {
            this.setContextKey4(StringUtils.toString(routeRrn));
        }
    }

    /**
     * contextKey5
     *
     * @return
     */
    public Long getEndOperationRrn() {
        return NumberUtils.createLong(StringUtils.trimToNull(this.getContextKey5()));
    }

    /**
     * contextKey5
     *
     * @param operationRrn
     */
    public void setEndOperationRrn(Long operationRrn) {
        if (operationRrn != null) {
            this.setContextKey5(StringUtils.toString(operationRrn));
        }
    }

    /**
     * contextKey6
     *
     * @return
     */
    public Integer getProcessVersion() {
        return NumberUtils.toInt(this.getContextKey6());
    }

    /**
     * contextKey6
     *
     * @param processVersion
     */
    public void setProcessVersion(Integer processVersion) {
        if (processVersion != null) {
            this.setContextKey6(StringUtils.toString(processVersion));
        }
    }

    /**
     * resultValue1
     *
     * @return
     */
    public Integer getLoopCount() {
        return NumberUtils.toInt(this.getResultValue1());
    }

    /**
     * resultValue1
     *
     * @param loopCount
     */
    public void setLoopCount(Integer loopCount) {
        if (loopCount != null) {
            this.setResultValue1(StringUtils.toString(loopCount));
        }
    }


}