null, when this value has not been computed
+ * (see {@link #isPartialResult()}).
*/
- public String getDescription()
+ public Optionaltrue, some values for this object have not been computed, yet. These values (like
+ * {@link #getLength()}, {@link #getDescription()} or {@link #getCommitDate()})
+ * will return {@link Optional#empty()} (or {@link OptionalLong#empty()} respectively), unless they are computed.
+ * There may be an asynchronous task running, that will set these values in the future.
+ *
+ * @since 2.0.0
+ *
+ * @return true, whenever some values of this object have not been computed, yet.
+ */
public boolean isPartialResult() {
return partialResult;
}
+ /**
+ * If this is true, some values for this object have not been computed and will not be computed. These
+ * values (like {@link #getLength()}, {@link #getDescription()} or {@link #getCommitDate()})
+ * will return {@link Optional#empty()} (or {@link OptionalLong#empty()} respectively), unless they are computed.
+ *
+ * @since 2.0.0
+ *
+ * @return true, whenever some values of this object finally are not computed.
+ */
public boolean isComputationAborted() {
return computationAborted;
}
@@ -255,14 +307,14 @@ public class FileObject implements LastModifiedAware, Serializable
}
/**
- * Sets the last modified date of the file.
+ * Sets the commit date of the file.
*
*
- * @param lastModified last modified date
+ * @param commitDate commit date
*/
- public void setLastModified(Long lastModified)
+ public void setCommitDate(Long commitDate)
{
- this.lastModified = lastModified;
+ this.commitDate = commitDate;
}
/**
@@ -271,7 +323,7 @@ public class FileObject implements LastModifiedAware, Serializable
*
* @param length file length
*/
- public void setLength(long length)
+ public void setLength(Long length)
{
this.length = length;
}
@@ -310,30 +362,47 @@ public class FileObject implements LastModifiedAware, Serializable
this.subRepository = subRepository;
}
+ /**
+ * Set marker, that some values for this object are not computed, yet.
+ *
+ * @since 2.0.0
+ *
+ * @param partialResult Set this to true, whenever some values of this object are not computed, yet.
+ */
public void setPartialResult(boolean partialResult) {
this.partialResult = partialResult;
}
+ /**
+ * Set marker, that computation of some values for this object has been aborted.
+ *
+ * @since 2.0.0
+ *
+ * @param computationAborted Set this to true, whenever some values of this object are not computed and
+ * will not be computed in the future.
+ */
public void setComputationAborted(boolean computationAborted) {
this.computationAborted = computationAborted;
}
- public Collection
{file.description.split("\n").map((item, key) => {
diff --git a/scm-ui/ui-webapp/src/repos/sources/modules/sources.test.ts b/scm-ui/ui-webapp/src/repos/sources/modules/sources.test.ts
index fd676d7c57..2d05c5814e 100644
--- a/scm-ui/ui-webapp/src/repos/sources/modules/sources.test.ts
+++ b/scm-ui/ui-webapp/src/repos/sources/modules/sources.test.ts
@@ -49,10 +49,8 @@ const collection = {
name: "src",
path: "src",
directory: true,
- description: "",
length: 176,
revision: "76aae4bb4ceacf0e88938eb5b6832738b7d537b4",
- lastModified: "",
subRepository: undefined,
_links: {
self: {
@@ -71,7 +69,7 @@ const collection = {
description: "bump version",
length: 780,
revision: "76aae4bb4ceacf0e88938eb5b6832738b7d537b4",
- lastModified: "2017-07-31T11:17:19Z",
+ commitDate: "2017-07-31T11:17:19Z",
subRepository: undefined,
_links: {
self: {
diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/BrowserResultToFileObjectDtoMapper.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/BrowserResultToFileObjectDtoMapper.java
index 866c2cc0b9..f9304881e7 100644
--- a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/BrowserResultToFileObjectDtoMapper.java
+++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/BrowserResultToFileObjectDtoMapper.java
@@ -15,6 +15,9 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import java.time.Instant;
+import java.util.Optional;
+import java.util.OptionalLong;
@Mapper
public abstract class BrowserResultToFileObjectDtoMapper extends BaseFileObjectDtoMapper {
@@ -39,6 +42,14 @@ public abstract class BrowserResultToFileObjectDtoMapper extends BaseFileObjectD
applyEnrichers(appender, fileObject, namespaceAndName, browserResult, browserResult.getRevision());
}
+ Optional