Created
November 22, 2025 15:58
-
-
Save trikitrok/15830619891cee3880cfb15d68338641 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 OpenClaimCommandBuilder { | |
| // some fields | |
| private OpenClaimCommandBuilder() {} | |
| public static OpenClaimCommandBuilder anOpenCommand() { | |
| return new OpenClaimCommandBuilder(); | |
| } | |
| public OpenClaimCommandBuilder of(ClaimDataBuilder claimBuilder) { | |
| this.claimBuilder = claimBuilder; | |
| return this; | |
| } | |
| public OpenClaimCommandBuilder of(ClaimBuilderX claimBuilderx) { | |
| this.claimBuilderx = claimBuilderx; | |
| return this; | |
| } | |
| // more setters | |
| public ClaimCommand build() { | |
| Objects.requireNonNull(company, "Company must not be null"); | |
| Claim claim; | |
| if(claimBuilderx != null) { | |
| claim = claimBuilderx.withStatus(ClaimStatus.ReadyToOpen).build(); | |
| } else { | |
| Objects.requireNonNull(claimBuilder, "ClaimBuilder must not be null"); | |
| claim = claimBuilder.withStatus(ClaimStatus.ReadyToOpen).build(); | |
| } | |
| return new OpenClaimCommand(claim, company); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment