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

com.credibledoc.substitution.reporting.placeholder.PlaceholderToReportDocumentService Maven / Gradle / Ivy

Go to download

This library serves for reports creation. These reports can describe a structure and behavior of some application or system. See the https://github.com/credibledoc/credible-doc/tree/master/substitution/substitution-reporting page.

There is a newer version: 1.0.51
Show newest version
package com.credibledoc.substitution.reporting.placeholder;

import com.credibledoc.substitution.core.placeholder.Placeholder;
import com.credibledoc.substitution.reporting.reportdocument.ReportDocument;

/**
 * The stateless service for working with relationship between {@link ReportDocument}
 * and {@link com.credibledoc.substitution.core.placeholder.Placeholder}.
 *
 * @author Kyrylo Semenko
 */
public class PlaceholderToReportDocumentService {

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

    /**
     * @return The {@link PlaceholderToReportDocumentService} singleton.
     */
    public static PlaceholderToReportDocumentService getInstance() {
        if (instance == null) {
            instance = new PlaceholderToReportDocumentService();
        }
        return instance;
    }

    /**
     * Find a value from {@link PlaceholderToReportDocumentRepository#getPlaceholderToReportDocumentMap()} by the key
     * @param placeholder a key
     * @return ReportDocument from the map.
     */
    public ReportDocument getReportDocument(Placeholder placeholder) {
        return PlaceholderToReportDocumentRepository.getInstance()
            .getPlaceholderToReportDocumentMap().get(placeholder);
    }

    /**
     * Put arguments to the {@link PlaceholderToReportDocumentRepository#getPlaceholderToReportDocumentMap()} map.
     * @param placeholder a key
     * @param reportDocument a value
     */
    public void putPlaceholderToReportDocument(Placeholder placeholder, ReportDocument reportDocument) {
        PlaceholderToReportDocumentRepository.getInstance()
            .getPlaceholderToReportDocumentMap().put(placeholder, reportDocument);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy