Skip to content

Remote Config Refactor Public and Response types - #481

Merged
lahirumaramba merged 4 commits into
remote-configfrom
lm-refactor-parameter
Oct 6, 2020
Merged

Remote Config Refactor Public and Response types#481
lahirumaramba merged 4 commits into
remote-configfrom
lm-refactor-parameter

Conversation

@lahirumaramba

Copy link
Copy Markdown
Member
  • Refactor public and response types
  • Change the response DTOs to simple java beans (with getters and setters)
  • Add protected ctors to public types to initialize from the corresponding response types

Related to: #446

@lahirumaramba
lahirumaramba force-pushed the lm-refactor-parameter branch from 7439447 to daceb34 Compare October 2, 2020 21:00

@hiranya911 hiranya911 left a comment

Copy link
Copy Markdown
Contributor

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.

parameters = new HashMap<>();
}

protected RemoteConfigTemplate(@NonNull TemplateResponse templateResponse) {

Copy link
Copy Markdown
Contributor

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

conditionalValues = new HashMap<>();
}

protected RemoteConfigParameter(@NonNull ParameterResponse parameterResponse) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No access modifier

Comment thread src/main/java/com/google/firebase/remoteconfig/RemoteConfigParameter.java Outdated
Comment thread src/main/java/com/google/firebase/remoteconfig/RemoteConfigParameter.java Outdated
Comment thread src/main/java/com/google/firebase/remoteconfig/RemoteConfigParameterValue.java Outdated
Comment thread src/main/java/com/google/firebase/remoteconfig/internal/TemplateResponse.java Outdated
Comment thread src/main/java/com/google/firebase/remoteconfig/internal/TemplateResponse.java Outdated
return RemoteConfigParameterValue.inAppDefault();
}
return RemoteConfigParameterValue.of(this.value);
public ParameterValueResponse setInAppDefaultValue(Boolean inAppDefaultValue) {

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Member Author

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?

@hiranya911 hiranya911 left a comment

Copy link
Copy Markdown
Contributor

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() {

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Updated!

@lahirumaramba
lahirumaramba merged commit 01d0c98 into remote-config Oct 6, 2020
@lahirumaramba
lahirumaramba deleted the lm-refactor-parameter branch October 6, 2020 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants