-
Notifications
You must be signed in to change notification settings - Fork 912
Expose endpointOverride through ServiceClientConfiguration #3900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"category": "AWS SDK for Java v2", | ||
"contributor": "", | ||
"type": "feature", | ||
"description": "Exposes endpointOverride in SdkClient through ServiceClientConfiguration" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
|
||
package software.amazon.awssdk.awscore; | ||
|
||
import java.net.URI; | ||
import java.util.Objects; | ||
import software.amazon.awssdk.annotations.SdkPublicApi; | ||
import software.amazon.awssdk.core.SdkServiceClientConfiguration; | ||
|
@@ -74,13 +75,20 @@ public interface Builder extends SdkServiceClientConfiguration.Builder { | |
*/ | ||
Builder region(Region region); | ||
|
||
@Override | ||
Builder overrideConfiguration(ClientOverrideConfiguration clientOverrideConfiguration); | ||
|
||
@Override | ||
Builder endpointOverride(URI endpointOverride); | ||
|
||
@Override | ||
AwsServiceClientConfiguration build(); | ||
} | ||
|
||
protected abstract static class BuilderImpl implements Builder { | ||
protected ClientOverrideConfiguration overrideConfiguration; | ||
protected Region region; | ||
protected URI endpointOverride; | ||
|
||
protected BuilderImpl() { | ||
} | ||
|
@@ -90,19 +98,6 @@ protected BuilderImpl(AwsServiceClientConfiguration awsServiceClientConfiguratio | |
this.region = awsServiceClientConfiguration.region(); | ||
} | ||
|
||
|
||
@Override | ||
public Builder overrideConfiguration(ClientOverrideConfiguration clientOverrideConfiguration) { | ||
this.overrideConfiguration = clientOverrideConfiguration; | ||
return this; | ||
} | ||
Comment on lines
-93
to
-98
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we have this on the interface? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added in Builder interface |
||
|
||
@Override | ||
public Builder region(Region region) { | ||
this.region = region; | ||
return this; | ||
} | ||
|
||
@Override | ||
public final ClientOverrideConfiguration overrideConfiguration() { | ||
return overrideConfiguration; | ||
|
@@ -112,6 +107,11 @@ public final ClientOverrideConfiguration overrideConfiguration() { | |
public final Region region() { | ||
return region; | ||
} | ||
|
||
@Override | ||
public final URI endpointOverride() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we have a setter on the interface to override the return type? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added overridden setters for endpointOverride and overrideConfiguration |
||
return endpointOverride; | ||
} | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I updated my example.
Boolean.TRUE.equals(clientConfiguration.option($T.ENDPOINT_OVERRIDDEN))
is safer/more correct. Can we use that instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1