com.credibledoc.substitution.reporting.placeholder.PlaceholderToReportDocumentService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of substitution-reporting Show documentation
Show all versions of substitution-reporting Show documentation
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.
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);
}
}