List of usage examples for java.util.function Supplier get
T get();
From source file:fi.helsinki.opintoni.service.NewsService.java
private List<NewsDto> getNews(Supplier<Feed> feedSupplier) { return feedSupplier.get().getEntries().stream().limit(4).map(newsConverter::toDto) .collect(Collectors.toList()); }
From source file:com.eclecticlogic.pedal.testing.NoopTransactionMock.java
/** * @see com.eclecticlogic.pedal.TransactionRunner#exec(java.util.function.Supplier) *///from w w w. j a v a 2 s . c o m @Override public <R> R exec(Supplier<R> block) { return block.get(); }
From source file:newcontroller.handler.impl.DefaultResponse.java
@Override public HandlerBridge with(Supplier<HandlerBridge> supplier) { return supplier.get(); }
From source file:com.savoirtech.eos.pattern.whiteboard.SingleWhiteboard.java
public S getService(Supplier<S> defaultSupplier) { return ObjectUtils.defaultIfNull(getService(), defaultSupplier.get()); }
From source file:onl.area51.httpd.action.Action.java
default Action andThenIf(boolean andThen, Supplier<Action> after) { return andThen ? andThen(after.get()) : this; }
From source file:onl.area51.httpd.action.Action.java
default Action composeIf(boolean compose, Supplier<Action> before) { return compose ? compose(before.get()) : this; }
From source file:io.github.carlomicieli.footballdb.starter.parsers.SeasonGamesParser.java
private TeamScore select(String at, Supplier<TeamScore> fst, Supplier<TeamScore> snd) { if (at.equals("@")) return snd.get(); else// w w w . j a v a2s . c o m return fst.get(); }
From source file:org.trustedanalytics.datasetpublisher.boundary.MetadataMapper.java
@Autowired public MetadataMapper(Supplier<Set<String>> restrictedKeywords) { this.restrictedKeywords = restrictedKeywords.get(); }
From source file:com.insightml.utils.types.cache.Cache.java
protected final V getOrLoad(final K key, final Supplier<V> loader) { return cache.computeIfAbsent(key, k -> loader.get()); }
From source file:se.curity.examples.oauth.ExternalResourceLoader.java
HttpClient loadJwkHttpClient() { String httpClientSupplierClassName = _properties.getProperty(HTTP_CLIENT_PROPERTY); try {// w w w . ja v a2s . co m Class<? extends Supplier> supplierType = Class.forName(httpClientSupplierClassName) .asSubclass(Supplier.class); _logger.info("Using HttpClientSupplier of type {}", supplierType.getName()); Supplier<?> supplier = supplierType.newInstance(); Object httpClient = supplier.get(); return HttpClient.class.cast(httpClient); } catch (Exception e) { _logger.warn("Unable to load httpClientSupplier from " + PROPERTIES_LOCATION + "\nWill fallback to the default HTTP Client", e); return new DefaultJwkHttpClientSupplier().get(); } }