-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from knaw-huc/TT-822_import_task_response_fixes
Import task response fixes
- Loading branch information
Showing
9 changed files
with
167 additions
and
51 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
54 changes: 54 additions & 0 deletions
54
textrepo-app/src/main/java/nl/knaw/huc/api/ResultImportDocument.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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package nl.knaw.huc.api; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.google.common.base.MoreObjects; | ||
import nl.knaw.huc.core.Document; | ||
import nl.knaw.huc.core.Version; | ||
|
||
import java.util.UUID; | ||
|
||
public class ResultImportDocument { | ||
private final Document document; | ||
private final Version version; | ||
private final boolean isNewVersion; | ||
|
||
public ResultImportDocument(Document document, Version version, boolean isNewVersion) { | ||
this.document = document; | ||
this.version = version; | ||
this.isNewVersion = isNewVersion; | ||
} | ||
|
||
@JsonProperty | ||
public UUID getDocumentId() { | ||
return document.getId(); | ||
} | ||
|
||
@JsonProperty | ||
public UUID getFileId() { | ||
return version.getFileId(); | ||
} | ||
|
||
@JsonProperty | ||
public UUID getVersionId() { | ||
return version.getId(); | ||
} | ||
|
||
@JsonProperty | ||
public String getContentsSha() { | ||
return version.getContentsSha(); | ||
} | ||
|
||
@JsonProperty | ||
public boolean isNewVersion() { | ||
return isNewVersion; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return MoreObjects.toStringHelper(this) | ||
.add("document", document) | ||
.add("version", version) | ||
.add("isNewVersion", isNewVersion) | ||
.toString(); | ||
} | ||
} |
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
Oops, something went wrong.