data7-master/data7/src/main/java/data7/model/vulnerability/VulnerabilitySet.java
package data7.model.vulnerability;

/*-
 * #%L
 * Data7
 * %%
 * Copyright (C) 2018 University of Luxembourg, Matthieu Jimenez
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */



import data7.project.Project;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * Vulnerability Dataset class
 */
public class VulnerabilitySet implements Serializable {

    private static final long serialVersionUID = 20180531L;

    private final Map<String, Vulnerability> vulnerabilityDataset;
    private long lastUpdated;
    private final String projectName;

    /**
     * Constructor
     *
     * @param projectName name of the project can be obtain through
     * @see Project#getName()
     * the last update correspond to the current time
     */
    public VulnerabilitySet(String projectName) {
        this.projectName = projectName;
        this.vulnerabilityDataset = new HashMap<>();
        this.lastUpdated = System.currentTimeMillis();
    }

    /**
     * @return
     */
    public Map<String, Vulnerability> getVulnerabilityDataset() {
        return vulnerabilityDataset;
    }

    /**
     * @return the timestamp of the last modification of the dataset
     */
    public long getLastUpdated() {
        return lastUpdated;
    }

    /**
     * update the dataset last modification timestamp to the current time
     */
    public void setLastUpdated(long updateTime) {
        this.lastUpdated = updateTime;
    }

    /**
     * @return the name of the project the dataset was built around
     */
    public String getProjectName() {
        return projectName;
    }
}
