TSK-1416: Truncation of Instant Membervariables
This commit is contained in:
parent
4152bf92d0
commit
8437b1fd6e
|
|
@ -1,6 +1,7 @@
|
||||||
package pro.taskana.classification.internal.models;
|
package pro.taskana.classification.internal.models;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import pro.taskana.classification.api.ClassificationCustomField;
|
import pro.taskana.classification.api.ClassificationCustomField;
|
||||||
|
|
@ -54,20 +55,20 @@ public class ClassificationImpl extends ClassificationSummaryImpl implements Cla
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instant getCreated() {
|
public Instant getCreated() {
|
||||||
return created;
|
return created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreated(Instant created) {
|
public void setCreated(Instant created) {
|
||||||
this.created = created;
|
this.created = created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instant getModified() {
|
public Instant getModified() {
|
||||||
return modified;
|
return modified != null ? modified.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setModified(Instant modified) {
|
public void setModified(Instant modified) {
|
||||||
this.modified = modified;
|
this.modified = modified != null ? modified.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package pro.taskana.common.api;
|
package pro.taskana.common.api;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
@ -28,7 +29,7 @@ public class ScheduledJob {
|
||||||
private int retryCount;
|
private int retryCount;
|
||||||
|
|
||||||
public ScheduledJob() {
|
public ScheduledJob() {
|
||||||
created = Instant.now();
|
created = Instant.now().truncatedTo(ChronoUnit.MILLIS);
|
||||||
state = State.READY;
|
state = State.READY;
|
||||||
retryCount = 0;
|
retryCount = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -50,19 +51,19 @@ public class ScheduledJob {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Instant getCreated() {
|
public Instant getCreated() {
|
||||||
return created;
|
return created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreated(Instant created) {
|
public void setCreated(Instant created) {
|
||||||
this.created = created;
|
this.created = created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Instant getDue() {
|
public Instant getDue() {
|
||||||
return due;
|
return due != null ? due.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDue(Instant due) {
|
public void setDue(Instant due) {
|
||||||
this.due = due;
|
this.due = due != null ? due.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public State getState() {
|
public State getState() {
|
||||||
|
|
@ -82,11 +83,11 @@ public class ScheduledJob {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Instant getLockExpires() {
|
public Instant getLockExpires() {
|
||||||
return lockExpires;
|
return lockExpires != null ? lockExpires.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLockExpires(Instant lockExpires) {
|
public void setLockExpires(Instant lockExpires) {
|
||||||
this.lockExpires = lockExpires;
|
this.lockExpires = lockExpires != null ? lockExpires.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, String> getArguments() {
|
public Map<String, String> getArguments() {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package pro.taskana.spi.history.api.events.classification;
|
package pro.taskana.spi.history.api.events.classification;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import pro.taskana.classification.api.ClassificationCustomField;
|
import pro.taskana.classification.api.ClassificationCustomField;
|
||||||
|
|
@ -134,11 +135,11 @@ public class ClassificationHistoryEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Instant getCreated() {
|
public Instant getCreated() {
|
||||||
return created;
|
return created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreated(Instant created) {
|
public void setCreated(Instant created) {
|
||||||
this.created = created;
|
this.created = created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserId() {
|
public String getUserId() {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package pro.taskana.spi.history.api.events.task;
|
package pro.taskana.spi.history.api.events.task;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import pro.taskana.common.api.exceptions.SystemException;
|
import pro.taskana.common.api.exceptions.SystemException;
|
||||||
|
|
@ -217,11 +218,11 @@ public class TaskHistoryEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Instant getCreated() {
|
public Instant getCreated() {
|
||||||
return created;
|
return created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreated(Instant created) {
|
public void setCreated(Instant created) {
|
||||||
this.created = created;
|
this.created = created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserId() {
|
public String getUserId() {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package pro.taskana.spi.history.api.events.workbasket;
|
package pro.taskana.spi.history.api.events.workbasket;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import pro.taskana.common.api.exceptions.SystemException;
|
import pro.taskana.common.api.exceptions.SystemException;
|
||||||
|
|
@ -102,11 +103,11 @@ public class WorkbasketHistoryEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Instant getCreated() {
|
public Instant getCreated() {
|
||||||
return created;
|
return created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreated(Instant created) {
|
public void setCreated(Instant created) {
|
||||||
this.created = created;
|
this.created = created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserId() {
|
public String getUserId() {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package pro.taskana.task.internal.models;
|
package pro.taskana.task.internal.models;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import pro.taskana.classification.api.models.ClassificationSummary;
|
import pro.taskana.classification.api.models.ClassificationSummary;
|
||||||
|
|
@ -51,20 +52,20 @@ public class AttachmentSummaryImpl implements AttachmentSummary {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instant getCreated() {
|
public Instant getCreated() {
|
||||||
return created;
|
return created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreated(Instant created) {
|
public void setCreated(Instant created) {
|
||||||
this.created = created;
|
this.created = created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instant getModified() {
|
public Instant getModified() {
|
||||||
return modified;
|
return modified != null ? modified.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setModified(Instant modified) {
|
public void setModified(Instant modified) {
|
||||||
this.modified = modified;
|
this.modified = modified != null ? modified.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -96,11 +97,11 @@ public class AttachmentSummaryImpl implements AttachmentSummary {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instant getReceived() {
|
public Instant getReceived() {
|
||||||
return received;
|
return received != null ? received.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReceived(Instant received) {
|
public void setReceived(Instant received) {
|
||||||
this.received = received;
|
this.received = received != null ? received.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package pro.taskana.task.internal.models;
|
package pro.taskana.task.internal.models;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import pro.taskana.task.api.CallbackState;
|
import pro.taskana.task.api.CallbackState;
|
||||||
|
|
@ -23,27 +24,27 @@ public class MinimalTaskSummary {
|
||||||
MinimalTaskSummary() {}
|
MinimalTaskSummary() {}
|
||||||
|
|
||||||
public Instant getPlanned() {
|
public Instant getPlanned() {
|
||||||
return planned;
|
return planned != null ? planned.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPlanned(Instant planned) {
|
public void setPlanned(Instant planned) {
|
||||||
this.planned = planned;
|
this.planned = planned != null ? planned.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Instant getDue() {
|
public Instant getDue() {
|
||||||
return due;
|
return due != null ? due.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDue(Instant due) {
|
public void setDue(Instant due) {
|
||||||
this.due = due;
|
this.due = due != null ? due.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Instant getModified() {
|
public Instant getModified() {
|
||||||
return modified;
|
return modified != null ? modified.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setModified(Instant modified) {
|
public void setModified(Instant modified) {
|
||||||
this.modified = modified;
|
this.modified = modified != null ? modified.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTaskId() {
|
public String getTaskId() {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package pro.taskana.task.internal.models;
|
package pro.taskana.task.internal.models;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import pro.taskana.task.api.models.TaskComment;
|
import pro.taskana.task.api.models.TaskComment;
|
||||||
|
|
@ -61,20 +62,20 @@ public class TaskCommentImpl implements TaskComment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instant getCreated() {
|
public Instant getCreated() {
|
||||||
return created;
|
return created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreated(Instant created) {
|
public void setCreated(Instant created) {
|
||||||
this.created = created;
|
this.created = created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instant getModified() {
|
public Instant getModified() {
|
||||||
return modified;
|
return modified != null ? modified.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setModified(Instant modified) {
|
public void setModified(Instant modified) {
|
||||||
this.modified = modified;
|
this.modified = modified != null ? modified.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package pro.taskana.task.internal.models;
|
package pro.taskana.task.internal.models;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
@ -131,56 +132,56 @@ public class TaskSummaryImpl implements TaskSummary {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instant getCreated() {
|
public Instant getCreated() {
|
||||||
return created;
|
return created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreated(Instant created) {
|
public void setCreated(Instant created) {
|
||||||
this.created = created;
|
this.created = created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instant getClaimed() {
|
public Instant getClaimed() {
|
||||||
return claimed;
|
return claimed != null ? claimed.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setClaimed(Instant claimed) {
|
public void setClaimed(Instant claimed) {
|
||||||
this.claimed = claimed;
|
this.claimed = claimed != null ? claimed.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instant getCompleted() {
|
public Instant getCompleted() {
|
||||||
return completed;
|
return completed != null ? completed.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCompleted(Instant completed) {
|
public void setCompleted(Instant completed) {
|
||||||
this.completed = completed;
|
this.completed = completed != null ? completed.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instant getModified() {
|
public Instant getModified() {
|
||||||
return modified;
|
return modified != null ? modified.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setModified(Instant modified) {
|
public void setModified(Instant modified) {
|
||||||
this.modified = modified;
|
this.modified = modified != null ? modified.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instant getPlanned() {
|
public Instant getPlanned() {
|
||||||
return planned;
|
return planned != null ? planned.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPlanned(Instant planned) {
|
public void setPlanned(Instant planned) {
|
||||||
this.planned = planned;
|
this.planned = planned != null ? planned.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instant getDue() {
|
public Instant getDue() {
|
||||||
return due;
|
return due != null ? due.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDue(Instant due) {
|
public void setDue(Instant due) {
|
||||||
this.due = due;
|
this.due = due != null ? due.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package pro.taskana.workbasket.internal.models;
|
package pro.taskana.workbasket.internal.models;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import pro.taskana.common.api.exceptions.SystemException;
|
import pro.taskana.common.api.exceptions.SystemException;
|
||||||
|
|
@ -50,20 +51,20 @@ public class WorkbasketImpl extends WorkbasketSummaryImpl implements Workbasket
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instant getCreated() {
|
public Instant getCreated() {
|
||||||
return created;
|
return created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreated(Instant created) {
|
public void setCreated(Instant created) {
|
||||||
this.created = created;
|
this.created = created != null ? created.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instant getModified() {
|
public Instant getModified() {
|
||||||
return modified;
|
return modified != null ? modified.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setModified(Instant modified) {
|
public void setModified(Instant modified) {
|
||||||
this.modified = modified;
|
this.modified = modified != null ? modified.truncatedTo(ChronoUnit.MILLIS) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue