-
Notifications
You must be signed in to change notification settings - Fork 16
HW-52637 pay pal account second line #39
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
HW-52637 pay pal account second line #39
Conversation
...in/java/com/hyperwallet/android/ui/transfermethod/PayPalAccountTransferMethodSecondLine.java
Outdated
Show resolved
Hide resolved
...in/java/com/hyperwallet/android/ui/transfermethod/PayPalAccountTransferMethodSecondLine.java
Outdated
Show resolved
Hide resolved
ui/src/main/java/com/hyperwallet/android/ui/transfermethod/SecondLinePresenter.java
Outdated
Show resolved
Hide resolved
...in/java/com/hyperwallet/android/ui/transfermethod/PayPalAccountTransferMethodSecondLine.java
Outdated
Show resolved
Hide resolved
ui/src/main/java/com/hyperwallet/android/ui/transfermethod/TransferMethodSecondLine.java
Outdated
Show resolved
Hide resolved
| case PREPAID_CARD: | ||
| case BANK_ACCOUNT: | ||
| case WIRE_ACCOUNT: | ||
| if (!mSecondLineStrategies.containsKey(TransferMethodSecondLine.class)) { |
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.
you don't need to check if it contains because maps will already do that for you when you call Map.put and I think put is good enough for this operation
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.
you can pre-initialize it no need to assemble it as it goes, like so
Map<String, String> doubleBraceMap = new HashMap<String, String>() {{
put("key1", "value1");
put("key2", "value2");
}};
| //noinspection ConstantConditions | ||
| return mSecondLineStrategies.get(TransferMethodSecondLine.class); | ||
| case PAYPAL_ACCOUNT: | ||
| if (!mSecondLineStrategies.containsKey(PayPalAccountTransferMethodSecondLine.class)) { |
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.
you don't need to check if it contains because maps will already do that for you when you call Map.put and I think put is good enough for this operation
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.
right and in case of Map.put we should also need to verify the previous value.
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.
you can pre-initialize it no need to assemble it as it goes, like so
Map<String, String> doubleBraceMap = new HashMap<String, String>() {{
put("key1", "value1");
put("key2", "value2");
}};
...c/main/java/com/hyperwallet/android/ui/transfermethod/TransferMethodSecondLinePresenter.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/hyperwallet/android/ui/transfermethod/TransferMethodSecondLineStrategy.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/hyperwallet/android/ui/transfermethod/TransferMethodSecondLineStrategy.java
Outdated
Show resolved
Hide resolved
...c/main/java/com/hyperwallet/android/ui/transfermethod/TransferMethodSecondLinePresenter.java
Outdated
Show resolved
Hide resolved
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.
@vshcherbyna-epam I really appreciate the effort and the robustness of the strategy pattern you introduced but I'd like to use a more simplistic approach. Creating an abstraction and managing instances with the map overcomplicate things and adds memory footprint in the app
Please expose a method in TransferMethodUtil class named getTransferMethodDetail(String): String use a switch case and return the correct value based on each transfer method type and empty in the default case
* HW-53384: Update UI group id
|
@fmattos-hw, @peter-joseph, @azakrevska-epam |
No description provided.