ProcessLocationContextValue.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 ProcessLocationContextValue extends ContextValue {

    private static final long serialVersionUID = 1L;

    public ProcessLocationContextValue() {
        this.setContextId(ContextNames.PROCESS_LOCATION_CONTEXT);
    }

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

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

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

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

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

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

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

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

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

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

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

    public String getProcessLocation() {
        return StringUtils.trimToNull(this.getResultValue1());
    }

    public void setProcessLocation(String processLocation) {
        if (StringUtils.isNotBlank(processLocation)) {
            this.setResultValue1(processLocation);
        }
    }

}