@Test public void testGetSelectedItem() { when(view.getValue()).thenReturn(SelectorTestObject.ITEM1.name()); SelectorTestObject selectedItem = tested.getSelectedItem(); assertEquals(SelectorTestObject.ITEM1, selectedItem); }
@Override public T getSelectedItem() { return itemProvider.apply(view.getValue()); }
SelectorImpl implements Selector<T> { @Override public T getSelectedItem() { return itemProvider.apply(view.getValue()); } }
SelectorImpl implements Selector<T> { @Override public T getSelectedItem() { return itemProvider.apply(view.getValue()); } @Inject  SelectorImpl(final SelectorView view); }
SelectorImpl implements Selector<T> { @Override public T getSelectedItem() { return itemProvider.apply(view.getValue()); } @Inject  SelectorImpl(final SelectorView view); @PostConstruct void init(); SelectorImpl<T> setTextProvider(final Function<T, String> textProvider); SelectorImpl<T> setValueProvider(final Function<T, String> valueProvider); SelectorImpl<T> setItemProvider(final Function<String, T> itemProvider); SelectorImpl<T> setValueChangedCommand(final Command valueChangedCommand); @Override Selector<T> addItem(final T item); @Override Selector<T> setSelectedItem(final T item); @Override T getSelectedItem(); @Override Selector<T> clear(); @Override void onValueChanged(); @PreDestroy void destroy(); @Override SelectorView getView(); }
SelectorImpl implements Selector<T> { @Override public T getSelectedItem() { return itemProvider.apply(view.getValue()); } @Inject  SelectorImpl(final SelectorView view); @PostConstruct void init(); SelectorImpl<T> setTextProvider(final Function<T, String> textProvider); SelectorImpl<T> setValueProvider(final Function<T, String> valueProvider); SelectorImpl<T> setItemProvider(final Function<String, T> itemProvider); SelectorImpl<T> setValueChangedCommand(final Command valueChangedCommand); @Override Selector<T> addItem(final T item); @Override Selector<T> setSelectedItem(final T item); @Override T getSelectedItem(); @Override Selector<T> clear(); @Override void onValueChanged(); @PreDestroy void destroy(); @Override SelectorView getView();  }