Skip to content

Conversation

lahirumaramba
Copy link
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
Copy link
Contributor

@hiranya911 hiranya911 left a 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) {
Copy link
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

@@ -45,6 +44,21 @@ public RemoteConfigParameter() {
conditionalValues = new HashMap<>();
}

protected RemoteConfigParameter(@NonNull ParameterResponse parameterResponse) {
Copy link
Contributor

Choose a reason for hiding this comment

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

No access modifier

return RemoteConfigParameterValue.inAppDefault();
}
return RemoteConfigParameterValue.of(this.value);
public ParameterValueResponse setInAppDefaultValue(Boolean inAppDefaultValue) {
Copy link
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
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?

Copy link
Contributor

@hiranya911 hiranya911 left a 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() {
Copy link
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
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