Skip to content

Commit

Permalink
Validate the bool params
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenbaker committed Aug 28, 2023
1 parent 6d099b1 commit 69e9b15
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ private V4aProperties(BuilderImpl builder) {
this.credentials = Validate.paramNotNull(builder.credentials, "Credentials");
this.credentialScope = Validate.paramNotNull(builder.credentialScope, "CredentialScope");
this.signingClock = Validate.paramNotNull(builder.signingClock, "SigningClock");
this.doubleUrlEncode = builder.doubleUrlEncode;
this.normalizePath = builder.normalizePath;
this.doubleUrlEncode = Validate.getOrDefault(builder.doubleUrlEncode, () -> true);
this.normalizePath = Validate.getOrDefault(builder.normalizePath, () -> true);
}

public AwsCredentialsIdentity getCredentials() {
Expand Down Expand Up @@ -78,9 +78,9 @@ public interface Builder {

Builder signingClock(Clock signingClock);

Builder doubleUrlEncode(boolean doubleUrlEncode);
Builder doubleUrlEncode(Boolean doubleUrlEncode);

Builder normalizePath(boolean normalizePath);
Builder normalizePath(Boolean normalizePath);

V4aProperties build();
}
Expand All @@ -89,8 +89,8 @@ private static class BuilderImpl implements Builder {
private AwsCredentialsIdentity credentials;
private CredentialScope credentialScope;
private Clock signingClock;
private boolean doubleUrlEncode;
private boolean normalizePath;
private Boolean doubleUrlEncode;
private Boolean normalizePath;

@Override
public Builder credentials(AwsCredentialsIdentity credentials) {
Expand All @@ -111,13 +111,13 @@ public Builder signingClock(Clock signingClock) {
}

@Override
public Builder doubleUrlEncode(boolean doubleUrlEncode) {
public Builder doubleUrlEncode(Boolean doubleUrlEncode) {
this.doubleUrlEncode = doubleUrlEncode;
return this;
}

@Override
public Builder normalizePath(boolean normalizePath) {
public Builder normalizePath(Boolean normalizePath) {
this.normalizePath = normalizePath;
return this;
}
Expand Down

0 comments on commit 69e9b15

Please sign in to comment.