-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DocumentData refactored to use generics DocumentType enum values changed
- Loading branch information
Showing
35 changed files
with
374 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 26 additions & 16 deletions
42
src/main/java/ch/sbb/polarion/extension/pdf_exporter/rest/model/DocumentData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
package ch.sbb.polarion.extension.pdf_exporter.rest.model; | ||
|
||
import com.polarion.alm.tracker.model.IModule; | ||
import com.polarion.alm.tracker.model.IRichPage; | ||
import com.polarion.alm.tracker.model.ITestRun; | ||
import com.polarion.alm.tracker.model.IWikiPage; | ||
import ch.sbb.polarion.extension.pdf_exporter.rest.model.conversion.DocumentType; | ||
import com.polarion.alm.projects.model.IUniqueObject; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
@Builder | ||
@Builder(builderMethodName = "create") | ||
@Getter | ||
public class DocumentData { | ||
private String projectName; | ||
private IModule document; | ||
private IWikiPage wikiPage; | ||
private IRichPage richPage; | ||
private ITestRun testRun; | ||
private String lastRevision; | ||
private String baselineName; | ||
private String documentId; | ||
private String documentTitle; | ||
private String documentContent; | ||
public class DocumentData<T extends IUniqueObject> { | ||
private final @NotNull DocumentType documentType; | ||
private final @NotNull T documentObject; | ||
|
||
private @NotNull String id; | ||
private @NotNull String title; | ||
private @Nullable String content; | ||
|
||
private @Nullable String projectName; | ||
private @Nullable String lastRevision; | ||
private @Nullable String baselineName; | ||
|
||
public static <T extends IUniqueObject> DocumentDataBuilder<T> builder(@NotNull DocumentType documentType, @NotNull T documentObject) { | ||
return DocumentData.<T>create() | ||
.documentType(documentType) | ||
.documentObject(documentObject); | ||
} | ||
|
||
// making javadoc maven plugin happy | ||
@SuppressWarnings("unused") | ||
public static class DocumentDataBuilder<T extends IUniqueObject> {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.