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

public class ResequenceContextValue extends ContextValue {

    private static final long serialVersionUID = 1L;

    public ResequenceContextValue() {
        this.setContextId(ContextNames.RESEQUENCE_CONTEXT);
    }

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

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

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

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

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

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

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

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

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

    /**
     * flow seq
     *
     * @return result value 1
     */
    public String getResequence() {
        return StringUtils.trimToNull(this.getResultValue1());
    }

    /**
     * @param resequence flow seq
     */
    public void setResequence(String resequence) {
        if (StringUtils.isNotBlank(resequence)) {
            this.setResultValue1(resequence);
        }
    }

}