Skip to content

Commit

Permalink
Rename formatter interface
Browse files Browse the repository at this point in the history
  • Loading branch information
sven1103 committed Oct 18, 2024
1 parent 5436703 commit 09dcb1e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @since <version tag>
*/
public interface Formatter {
public interface FileFormatSupplier {

File from(String fileName, ResearchProject researchProject) throws FormatException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package life.qbic.datamanager.export.docx;

import java.io.File;
import life.qbic.datamanager.export.Formatter;
import life.qbic.datamanager.export.FileFormatSupplier;
import life.qbic.datamanager.export.model.ContactPoint;
import life.qbic.datamanager.export.model.ResearchProject;
import org.docx4j.openpackaging.exceptions.Docx4JException;
Expand All @@ -15,10 +15,10 @@
*
* @since 1.0.0
*/
public class DocxFormatter implements Formatter {
public class DocxSupplier implements FileFormatSupplier {

public static DocxFormatter create() {
return new DocxFormatter();
public static DocxSupplier create() {
return new DocxSupplier();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import java.util.ArrayList;
import java.util.Objects;
import life.qbic.datamanager.export.TempDirectory;
import life.qbic.datamanager.export.docx.DocxFormatter;
import life.qbic.datamanager.export.docx.DocxSupplier;
import life.qbic.datamanager.export.model.ContactPoint;
import life.qbic.datamanager.export.model.ResearchProject;
import life.qbic.datamanager.export.yaml.YamlFormatter;
import life.qbic.datamanager.export.yaml.YamlSupplier;
import life.qbic.projectmanagement.domain.model.project.Contact;
import life.qbic.projectmanagement.domain.model.project.Project;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -37,9 +37,9 @@ public ROCreateBuilder(TempDirectory tempDir) {
}

private static RoCrate buildRoCrate(Path buildDir, ResearchProject researchProject) {
var projectInfoDocx = DocxFormatter.create()
var projectInfoDocx = DocxSupplier.create()
.from(buildDir.resolve(SUMMARY_FILENAME_DOCX.value()).toString(), researchProject);
var projectInfoYaml = YamlFormatter.create()
var projectInfoYaml = YamlSupplier.create()
.from(buildDir.resolve(SUMMARY_FILENAME_YAML.value()).toString(), researchProject);
return new RoCrate.RoCrateBuilder(
"QBiC-project-%s-ro-crate".formatted(researchProject.identifier()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import java.io.File;
import java.io.IOException;
import life.qbic.datamanager.export.Formatter;
import life.qbic.datamanager.export.FileFormatSupplier;
import life.qbic.datamanager.export.model.ResearchProject;

/**
Expand All @@ -14,10 +14,10 @@
*
* @since 1.0.0
*/
public class YamlFormatter implements Formatter {
public class YamlSupplier implements FileFormatSupplier {

public static YamlFormatter create() {
return new YamlFormatter();
public static YamlSupplier create() {
return new YamlSupplier();
}

@Override
Expand Down

0 comments on commit 09dcb1e

Please sign in to comment.