package com.capgemini.framework.common;

import lombok.EqualsAndHashCode;

/** Static class managing all properties from quartz.properties file. **/
@EqualsAndHashCode(callSuper = true)
public class QuartzHelper extends AbstractPropertiesManager {

    /** Singleton instance. **/
    private static QuartzHelper instance;

    /** Prefix that should be appended at the beginning of all properties. **/
    private static final String PROP_PREFIX = "org.quartz.";

    /** Constructor : load the properties from the property file. **/
    private QuartzHelper() {
        super("/quartz.properties");
    }

    /** @return the instance. **/
    public static synchronized QuartzHelper getInstance() {
        if (instance == null) {
            instance = new QuartzHelper();
        }
        return instance;
    }

    @Override
    protected String getPropPrefix() {
        return PROP_PREFIX;
    }

    /**
     * Get the file path of the quartz.properties file.
     *
     * @return string value of the file path
     */
    public static String getPropertiesFilePath() {
        return getInstance().getPropertiesFilePathImpl();
    }

    private String getPropertiesFilePathImpl() {
        return propertyFilePath;
    }
}
