Created
November 20, 2025 09:27
-
-
Save trikitrok/88ce9749e16444c895e5b4cb56a4055d 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 { | |
| private Company company; | |
| private ClaimDataBuilder claimBuilder; | |
| private OpenClaimCommandBuilder() {} | |
| public static OpenClaimCommandBuilder anOpenCommand() { | |
| return new OpenClaimCommandBuilder(); | |
| } | |
| public OpenClaimCommandBuilder inCompany(Company company) { | |
| this.company = company; | |
| return this; | |
| } | |
| public OpenClaimCommandBuilder of(ClaimDataBuilder claimBuilder) { | |
| this.claimBuilder = claimBuilder; | |
| return this; | |
| } | |
| public ClaimCommand build() { | |
| Objects.requireNonNull(company, "Company must not be null"); | |
| Objects.requireNonNull(claimBuilder, "ClaimBuilder must not be null"); | |
| return new OpenClaimCommand( | |
| claimBuilder.withStatus(ClaimStatus.ReadyToOpen).build(), | |
| company | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment