class PipelineRun extends AbstractSecuredEntity {

    public void parseParameters() {
        pipelineRunParameters = new ArrayList<>();
        if (StringUtils.hasText(params)) {
            String[] parts = params.split("\\|");

            pipelineRunParameters = Arrays.stream(parts)
                    .map(part -> {
                        String[] chunks = part.split(KEY_VALUE_DELIMITER);
                        if (chunks.length == 2) {
                            return new PipelineRunParameter(chunks[0], chunks[1]);
                        } else if (chunks.length == 3) {
                            return new PipelineRunParameter(chunks[0], chunks[1], chunks[2]);
                        }
                        return new PipelineRunParameter(part);
                    })
                    .collect(Collectors.toList());
        }

        if (parentRunId != null &&
                pipelineRunParameters.stream().noneMatch(p -> p.getName().equals(PARENT_ID_PARAM))) {
            pipelineRunParameters.add(new PipelineRunParameter(PARENT_ID_PARAM, parentRunId.toString()));
        }
    }

    public  PipelineRun();
    public  PipelineRun(Long id, String name);

}