Last active
November 22, 2025 10:53
-
-
Save trikitrok/7a86f0b0c19efff00f277e9a2ad0ed63 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // some imports... | |
| public class NotifyOpenedClaimCommandBuilder { | |
| private ClaimsOpeningListener openingListener; | |
| private ClaimReferenceInCompany referenceInCompany; | |
| private ClaimDataBuilder claimBuilder; | |
| public static NotifyOpenedClaimCommandBuilder aNotifyOpenedCommand() { | |
| return new NotifyOpenedClaimCommandBuilder(); | |
| } | |
| public NotifyOpenedClaimCommandBuilder usingOpeningListener(ClaimsOpeningListener openingListener) { | |
| this.openingListener = openingListener; | |
| return this; | |
| } | |
| public NotifyOpenedClaimCommandBuilder withReferenceInCompany(String referenceInCompany) { | |
| this.referenceInCompany = claimReferenceInCompany(referenceInCompany); | |
| return this; | |
| } | |
| public NotifyOpenedClaimCommandBuilder of(ClaimDataBuilder claimBuilder) { | |
| this.claimBuilder = claimBuilder; | |
| return this; | |
| } | |
| public ClaimCommand build() { | |
| Objects.requireNonNull(openingListener, "Claims Opening Listener must not be null"); | |
| Objects.requireNonNull(referenceInCompany, "Reference In Company must not be null"); | |
| Objects.requireNonNull(claimBuilder, "Claim Builder must not be null"); | |
| return new NotifyOpenedClaimCommand( | |
| openingListener, | |
| referenceInCompany, | |
| claimBuilder.withStatus(ClaimStatus.OpenInCompanyButNotNotified).build() | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment