Skip to content

Commit

Permalink
chore: refactoring
Browse files Browse the repository at this point in the history
DocumentData refactored to use generics
  • Loading branch information
grigoriev committed Sep 10, 2024
1 parent 3575498 commit 7d231b6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ protected String serializeModelData() {

@Override
protected void deserializeModelData(String serializedString) {
documentNameTemplate = deserializeEntry(LIVE_DOC_NAME_TEMPLATE, serializedString, FileNameTemplateSettings.DEFAULT_DOCUMENT_NAME_TEMPLATE);
reportNameTemplate = deserializeEntry(LIVE_REPORT_NAME_TEMPLATE, serializedString, FileNameTemplateSettings.DEFAULT_REPORT_NAME_TEMPLATE);
testRunNameTemplate = deserializeEntry(TEST_RUN_NAME_TEMPLATE, serializedString, FileNameTemplateSettings.DEFAULT_TESTRUN_NAME_TEMPLATE);
wikiNameTemplate = deserializeEntry(WIKI_PAGE_NAME_TEMPLATE, serializedString, FileNameTemplateSettings.DEFAULT_WIKI_NAME_TEMPLATE);
documentNameTemplate = deserializeEntry(LIVE_DOC_NAME_TEMPLATE, serializedString, FileNameTemplateSettings.DEFAULT_LIVE_DOC_NAME_TEMPLATE);
reportNameTemplate = deserializeEntry(LIVE_REPORT_NAME_TEMPLATE, serializedString, FileNameTemplateSettings.DEFAULT_LIVE_REPORT_NAME_TEMPLATE);
testRunNameTemplate = deserializeEntry(TEST_RUN_NAME_TEMPLATE, serializedString, FileNameTemplateSettings.DEFAULT_TEST_RUN_NAME_TEMPLATE);
wikiNameTemplate = deserializeEntry(WIKI_PAGE_NAME_TEMPLATE, serializedString, FileNameTemplateSettings.DEFAULT_WIKI_PAGE_NAME_TEMPLATE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

public class FileNameTemplateSettings extends GenericNamedSettings<FileNameTemplateModel> {
public static final String FEATURE_NAME = "filename-template";
public static final String DEFAULT_DOCUMENT_NAME_TEMPLATE = "$projectName $document.moduleNameWithSpace.replace(\" / \", \" \")";
public static final String DEFAULT_REPORT_NAME_TEMPLATE = "$projectName $page.pageNameWithSpace.replace(\" / \", \" \") $page.lastRevision";
public static final String DEFAULT_TESTRUN_NAME_TEMPLATE = "$projectName $testrun.label";
public static final String DEFAULT_WIKI_NAME_TEMPLATE = "$projectName $page.pageNameWithSpace.replace(\" / \", \" \") $page.lastRevision";
public static final String DEFAULT_LIVE_DOC_NAME_TEMPLATE = "$projectName $document.moduleNameWithSpace.replace(\" / \", \" \")";
public static final String DEFAULT_LIVE_REPORT_NAME_TEMPLATE = "$projectName $page.pageNameWithSpace.replace(\" / \", \" \") $page.lastRevision";
public static final String DEFAULT_TEST_RUN_NAME_TEMPLATE = "$projectName $testrun.label";
public static final String DEFAULT_WIKI_PAGE_NAME_TEMPLATE = "$projectName $page.pageNameWithSpace.replace(\" / \", \" \") $page.lastRevision";

public FileNameTemplateSettings() {
super(FEATURE_NAME);
Expand All @@ -23,10 +23,10 @@ public FileNameTemplateSettings(SettingsService settingsService) {
@Override
public @NotNull FileNameTemplateModel defaultValues() {
return FileNameTemplateModel.builder()
.documentNameTemplate(DEFAULT_DOCUMENT_NAME_TEMPLATE)
.reportNameTemplate(DEFAULT_REPORT_NAME_TEMPLATE)
.testRunNameTemplate(DEFAULT_TESTRUN_NAME_TEMPLATE)
.wikiNameTemplate(DEFAULT_WIKI_NAME_TEMPLATE)
.documentNameTemplate(DEFAULT_LIVE_DOC_NAME_TEMPLATE)
.reportNameTemplate(DEFAULT_LIVE_REPORT_NAME_TEMPLATE)
.testRunNameTemplate(DEFAULT_TEST_RUN_NAME_TEMPLATE)
.wikiNameTemplate(DEFAULT_WIKI_PAGE_NAME_TEMPLATE)
.build();
}
}

0 comments on commit 7d231b6

Please sign in to comment.