All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aventstack.extentreports.reporter.configuration.BasicConfiguration Maven / Gradle / Ivy

There is a newer version: 5.1.2
Show newest version
package com.aventstack.extentreports.reporter.configuration;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.aventstack.extentreports.Status;

abstract class BasicConfiguration {

    protected List levels;
    protected String reportName;
    protected String timeStampFormat;
    protected Map usedConfigs;

    public BasicConfiguration() {
        usedConfigs = new HashMap<>();
    }

    public Map getConfigMap() {
        return usedConfigs;
    }

    public void setLevel(Status... level) {
        if (levels == null)
            levels = new ArrayList<>();

        Arrays.stream(level).forEach(levels::add);
    }

    public List getLevel() {
        return levels;
    }

    /**
     * Gets the timestamp format
     *
     * @return The time stamp format
     */
    public String getTimeStampFormat() {
        return usedConfigs.get("timeStampFormat");
    }

    /**
     * Sets the timestamp format
     *
     * @param timeStampFormat The desired time stamp format
     *                        See http://freemarker.org/docs/ref_builtins_date.html#ref_builtin_string_for_date
     */
    public void setTimeStampFormat(String timeStampFormat) {
        usedConfigs.put("timeStampFormat", timeStampFormat);
        this.timeStampFormat = timeStampFormat;
    }

    public void setReportName(String reportName) {
        usedConfigs.put("reportName", reportName);
        this.reportName = reportName;
    }

    public String getReportName() {
        return reportName;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy