-
Notifications
You must be signed in to change notification settings - Fork 290
Remote Config Refactor Public and Response types #481
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
Conversation
e205b62
to
7439447
Compare
7439447
to
daceb34
Compare
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.
Looks great. The new pattern is working out nicely. Just a few nits to clean up the code.
@@ -39,6 +39,17 @@ public RemoteConfigTemplate() { | |||
parameters = new HashMap<>(); | |||
} | |||
|
|||
protected RemoteConfigTemplate(@NonNull TemplateResponse templateResponse) { |
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.
No access modifier to make it package-protected
@@ -45,6 +44,21 @@ public RemoteConfigParameter() { | |||
conditionalValues = new HashMap<>(); | |||
} | |||
|
|||
protected RemoteConfigParameter(@NonNull ParameterResponse parameterResponse) { |
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.
No access modifier
src/main/java/com/google/firebase/remoteconfig/RemoteConfigParameter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/firebase/remoteconfig/RemoteConfigParameter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/firebase/remoteconfig/RemoteConfigParameterValue.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/firebase/remoteconfig/internal/TemplateResponse.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/firebase/remoteconfig/internal/TemplateResponse.java
Outdated
Show resolved
Hide resolved
return RemoteConfigParameterValue.inAppDefault(); | ||
} | ||
return RemoteConfigParameterValue.of(this.value); | ||
public ParameterValueResponse setInAppDefaultValue(Boolean inAppDefaultValue) { |
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.
Implement a setter that matches the getter you choose to implement.
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.
Should the getter take a boolean
?
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.
LGTM with a suggestion.
private ParameterValueResponse(String value, Boolean inAppDefaultValue) { | ||
this.value = value; | ||
this.inAppDefaultValue = inAppDefaultValue; | ||
public Boolean getUseInAppDefault() { |
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.
Is this used anywhere? If not lets remove it. And also change the setter to accept boolean
so it matches the getter.
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.
Good call. Updated!
public
andresponse
typesresponse
DTOs to simple java beans (with getters and setters)protected
ctors
topublic
types to initialize from the correspondingresponse
typesRelated to: #446