Skip to content

Instantly share code, notes, and snippets.

@trikitrok
Created November 22, 2025 16:07
Show Gist options
  • Select an option

  • Save trikitrok/487a673c04d69bef80d7df12d1422707 to your computer and use it in GitHub Desktop.

Select an option

Save trikitrok/487a673c04d69bef80d7df12d1422707 to your computer and use it in GitHub Desktop.
// some imports
public class NotifyOpenedClaimCommandBuilder {
// some fields
public static NotifyOpenedClaimCommandBuilder aNotifyOpenedCommand() {
return new NotifyOpenedClaimCommandBuilder();
}
public NotifyOpenedClaimCommandBuilder of(ClaimDataBuilder claimBuilder) {
this.claimBuilder = claimBuilder;
return this;
}
public NotifyOpenedClaimCommandBuilder of(ClaimBuilderX claimBuilderx) {
this.claimBuilderx = claimBuilderx;
return this;
}
// more setters
public ClaimCommand build() {
Objects.requireNonNull(openingListener, "Claims Opening Listener must not be null");
Objects.requireNonNull(referenceInCompany, "Reference In Company must not be null");
Claim claim;
if(claimBuilderx != null) {
claim = claimBuilderx.withStatus(ClaimStatus.OpenInCompanyButNotNotified).build();
} else {
Objects.requireNonNull(claimBuilder, "Claim Builder must not be null");
claim = claimBuilder.withStatus(ClaimStatus.OpenInCompanyButNotNotified).build();
}
return new NotifyOpenedClaimCommand(openingListener, referenceInCompany, claim);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment