001/*
002 *  Copyright 2022 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.cms.workflow.history;
017
018import java.util.ArrayList;
019import java.util.HashSet;
020import java.util.List;
021import java.util.Set;
022
023/**
024 * Object representing a workflow history
025 */
026public class WorkflowHistory 
027{
028    private List<HistoryStep> _steps;
029    private Set<String> _validatedVersions;
030    
031    /**
032     * The constructor
033     */
034    public WorkflowHistory()
035    {
036        this._steps = new ArrayList<>();
037        this._validatedVersions = new HashSet<>();
038    }
039    
040    /**
041     * Get the list of step
042     * @return the list of step
043     */
044    public List<HistoryStep> getSteps()
045    {
046        return this._steps;
047    }
048    
049    /**
050     * Add the step
051     * @param step the step
052     */
053    public void addStep(HistoryStep step)
054    {
055        this._steps.add(step);
056    }
057
058    /**
059     * Get the validated versions
060     * @return the validated versions
061     */
062    public Set<String> getValidatedVersions()
063    {
064        return this._validatedVersions;
065    }
066    
067    /**
068     * Add a validated version
069     * @param versionName the version name
070     */
071    public void addValidatedVersion(String versionName)
072    {
073        _validatedVersions.add(versionName);
074    }
075}