Refactor anonymous class to inner class
@@ -148,13 +148,7 @@ public final class EacNavigator extends MobileNavigator {
String tInfo = getTransactionInfo();
final Promise<List<OutputInfoUnit>> waitForAttributes = new Promise<>();
- ConfirmAttributeSelectionOperation selectionConfirmation = new ConfirmAttributeSelectionOperation() {
- @Override
- public void enter(List<SelectableItem> readAttr, List<SelectableItem> writeAttr) {
- List<OutputInfoUnit> outInfo = sd.getSelection(readAttr, writeAttr);
- waitForAttributes.deliver(outInfo);
- }
- };
+ ConfirmAttributeSelectionOperation selectionConfirmation = new ConfirmAttributeSelectionOperationImpl(sd, waitForAttributes);
try {
interaction.onServerData(sd, tInfo, selectionConfirmation);
@@ -344,4 +338,21 @@ public final class EacNavigator extends MobileNavigator {
return result;
}
+ private static class ConfirmAttributeSelectionOperationImpl implements ConfirmAttributeSelectionOperation {
+
+ private final ServerDataImpl sd;
+ private final Promise<List<OutputInfoUnit>> waitForAttributes;
+
+ public ConfirmAttributeSelectionOperationImpl(ServerDataImpl sd, Promise<List<OutputInfoUnit>> waitForAttributes) {
+ this.sd = sd;
+ this.waitForAttributes = waitForAttributes;
+ }
+
+ @Override
+ public void enter(List<SelectableItem> readAttr, List<SelectableItem> writeAttr) {
+ List<OutputInfoUnit> outInfo = sd.getSelection(readAttr, writeAttr);
+ waitForAttributes.deliver(outInfo);
+ }
+ }
+
}
