ProcessSpecItemBuildParameterDto.java

package com.mycim.valueobject.prp;

import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;

public class ProcessSpecItemBuildParameterDto {

    private final ProcessSpecInfo processSpecInfo;

    private Set<Long> reworkRrnInProcessSet;

    private Map<String, ProcessAttributeDto> attributes;

    private Map<String, String> stageIdKeyMap;

    private Map<String, String> operationTypeKeyMap;

    private Map<String, String> workAreaKeyMap;

    private Map<String, String> flipTypeMap;

    public ProcessSpecItemBuildParameterDto(ProcessSpecInfo processSpecInfo) {
        this.processSpecInfo = processSpecInfo;
    }

    public Map<String, String> getFlipTypeMap() {
        if (flipTypeMap == null) {
            flipTypeMap = Collections.emptyMap();
        }
        return flipTypeMap;
    }

    public ProcessSpecItemBuildParameterDto setFlipTypeMap(Map<String, String> flipTypeMap) {
        this.flipTypeMap = flipTypeMap;
        return this;
    }

    public ProcessSpecInfo getProcessSpecInfo() {
        return processSpecInfo;
    }

    public Set<Long> getReworkRrnInProcessSet() {
        if (reworkRrnInProcessSet == null) {
            reworkRrnInProcessSet = new LinkedHashSet<>();
        }
        return reworkRrnInProcessSet;
    }

    public Map<String, ProcessAttributeDto> getAttributes() {
        if (attributes == null) {
            attributes = Collections.emptyMap();
        }
        return attributes;
    }

    public ProcessSpecItemBuildParameterDto setAttributes(Map<String, ProcessAttributeDto> attributes) {
        this.attributes = attributes;
        return this;
    }

    public ProcessAttributeDto getAttribute(String key) {
        return getAttributes().get(key);
    }

    public Map<String, String> getStageIdKeyMap() {
        if (stageIdKeyMap == null) {
            stageIdKeyMap = Collections.emptyMap();
        }
        return stageIdKeyMap;
    }

    public ProcessSpecItemBuildParameterDto setStageIdKeyMap(Map<String, String> stageIdKeyMap) {
        this.stageIdKeyMap = stageIdKeyMap;
        return this;
    }

    public String getStageIdDesc(String stageId) {
        return getStageIdKeyMap().get(stageId);
    }

    public Map<String, String> getOperationTypeKeyMap() {
        if (operationTypeKeyMap == null) {
            operationTypeKeyMap = Collections.emptyMap();
        }
        return operationTypeKeyMap;
    }

    public ProcessSpecItemBuildParameterDto setOperationTypeKeyMap(Map<String, String> operationTypeKeyMap) {
        this.operationTypeKeyMap = operationTypeKeyMap;
        return this;
    }

    public String getOperationTypeDesc(String operationType) {
        return getOperationTypeKeyMap().get(operationType);
    }

    public Map<String, String> getWorkAreaKeyMap() {
        if (workAreaKeyMap == null) {
            workAreaKeyMap = Collections.emptyMap();
        }
        return workAreaKeyMap;
    }

    public ProcessSpecItemBuildParameterDto setWorkAreaKeyMap(Map<String, String> workAreaKeyMap) {
        this.workAreaKeyMap = workAreaKeyMap;
        return this;
    }

    public String getWorkAreaDesc(String workArea) {
        return getWorkAreaKeyMap().get(workArea);
    }

    public String getFlipTypeDesc(String flipType) {
        return getFlipTypeMap().get(flipType);
    }

}