@Test void getDefaultOnError() { final DefaultValueOnErrorDecorator<String> decorator = new DefaultValueOnErrorDecorator<>(commandThrows, "default"); decorator.run(); Assertions.assertNotNull(decorator.get()); Assertions.assertEquals("default", decorator.get()); }
@Override public R get() { try { return getDelegate().get(); } catch (Exception e) { return defaultValue; } }
DefaultValueOnErrorDecorator extends AbstractDecoratorCommand<R> implements CanonCommand<R> { @Override public R get() { try { return getDelegate().get(); } catch (Exception e) { return defaultValue; } } }
DefaultValueOnErrorDecorator extends AbstractDecoratorCommand<R> implements CanonCommand<R> { @Override public R get() { try { return getDelegate().get(); } catch (Exception e) { return defaultValue; } } DefaultValueOnErrorDecorator(final CanonCommand<R> delegate);  DefaultValueOnErrorDecorator(final CanonCommand<R> delegate, final R defaultValue);  DefaultValueOnErrorDecorator(final FakeClassArgument fake, final DefaultValueOnErrorDecorator<R> toCopy); }
DefaultValueOnErrorDecorator extends AbstractDecoratorCommand<R> implements CanonCommand<R> { @Override public R get() { try { return getDelegate().get(); } catch (Exception e) { return defaultValue; } } DefaultValueOnErrorDecorator(final CanonCommand<R> delegate);  DefaultValueOnErrorDecorator(final CanonCommand<R> delegate, final R defaultValue);  DefaultValueOnErrorDecorator(final FakeClassArgument fake, final DefaultValueOnErrorDecorator<R> toCopy); @Override R get(); @Override Optional<R> getOpt(); }
DefaultValueOnErrorDecorator extends AbstractDecoratorCommand<R> implements CanonCommand<R> { @Override public R get() { try { return getDelegate().get(); } catch (Exception e) { return defaultValue; } } DefaultValueOnErrorDecorator(final CanonCommand<R> delegate);  DefaultValueOnErrorDecorator(final CanonCommand<R> delegate, final R defaultValue);  DefaultValueOnErrorDecorator(final FakeClassArgument fake, final DefaultValueOnErrorDecorator<R> toCopy); @Override R get(); @Override Optional<R> getOpt();  }