Skip to content

Commit

Permalink
chore(impl): [eclipse-tractusx#841] add helper methods to ProcessingE…
Browse files Browse the repository at this point in the history
…rrorBuilder
  • Loading branch information
dsmf committed Jul 29, 2024
1 parent f0098f4 commit 8a17e05
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
********************************************************************************/
package org.eclipse.tractusx.irs.component;

import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.List;

Expand All @@ -42,6 +43,7 @@
@Builder(toBuilder = true, setterPrefix = "with")
@JsonDeserialize(builder = ProcessingError.ProcessingErrorBuilder.class)
public class ProcessingError {

private ProcessStep processStep;
private String errorDetail;
private ZonedDateTime lastAttempt;
Expand All @@ -58,5 +60,14 @@ public class ProcessingError {
@JsonPOJOBuilder()
public static class ProcessingErrorBuilder {

public ProcessingErrorBuilder withLastAttemptNow() {
return this.withLastAttempt(ZonedDateTime.now(ZoneOffset.UTC));
}

public ProcessingErrorBuilder withRetryCounterAndLastAttemptNow(final int retryCount) {
return this.withLastAttemptNow().withRetryCounter(retryCount);
}

}

}

0 comments on commit 8a17e05

Please sign in to comment.