本文整理汇总了Java中io.vavr.collection.HashSet.ofAll方法的典型用法代码示例。如果您正苦于以下问题:Java HashSet.ofAll方法的具体用法?Java HashSet.ofAll怎么用?Java HashSet.ofAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.vavr.collection.HashSet
的用法示例。
在下文中一共展示了HashSet.ofAll方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import io.vavr.collection.HashSet; //导入方法依赖的package包/类
@PostConstruct
public void init() {
// start with our preset list...
Set<Ticker> tickersAll = HashSet.ofAll(TurbineFuelConstants.PRESET_TICKERS);
// get any tickers from elasticsearch...
List<Ticker> tickersFromEs = elasticsearch.findTickersByExchange(ExchangeEnum.LSE);
// tickers.forEach(t -> logger.info(t.toString()));
// NOTE: this doesn't trap uncheck exceptions...
// List<Ticker> tickersFromEs = Try.of(() -> elasticsearch.findTickersByExchange(ExchangeEnum.LSE)).getOrElse(new
// ArrayList<Ticker>());
// TODO better way to do this with Option?
if (tickersFromEs == null || tickersFromEs.isEmpty()) {
logger.warn("WARNING: no tickers found in elasticsearch, only our hardcoded watches will be available to start with: {}",
TurbineFuelConstants.PRESET_TICKERS);
} else {
tickersAll = TurbineFuelConstants.PRESET_TICKERS.addAll(tickersFromEs);
}
// create realtime simulations of watches and/or tickers from elasticsearch...
tickersAll
// restrict to only preset tickers for now...
.filter(tick -> TurbineFuelConstants.PRESET_TICKERS.contains(tick))
.map(tick -> findOrCreateTickProducer(tick))
.forEach(producer -> producers = producers.add(producer));
}
示例2: init
import io.vavr.collection.HashSet; //导入方法依赖的package包/类
@PostConstruct
public void init() {
// turbineIndicators.addAll(turbineService.findIndicators());
turbineIndicators.addAll(turbineService.getIndicatorInstances());
turbineStrategies.addAll(turbineService.findStrategies());
// environment.getActiveProfiles();
// TODO temporary...!!!
// if (true)
// return;
List<Ticker> tickersFromEs = elasticsearch.findTickersByExchange(ExchangeEnum.LSE);
if (tickersFromEs == null || tickersFromEs.isEmpty()) {
logger.warn(" !!!! WARNING ---- no tickers found in elasticsearch ---- !!!!");
} else {
tickers = HashSet.ofAll(tickersFromEs);
}
stocks = tickers.map(t -> Stock.of(t, turbineIndicators, turbineStrategies));
List<String> rics = tickers.map(ticker -> ticker.getRicAsString()).toJavaList();
logger.info("setting up for {} tickers : {}", rics.size(), rics);
// recover the history...
stocks
.map(stock -> Tuple.of(stock,
Option.of(elasticsearch.findTicksByRic(stock.getTicker().getRicAsString())).getOrElse(new ArrayList<>())))
.peek(tuple -> logger.info("recovering:{}:{}", tuple._1, tuple._2.size()))
.filter(tuple -> !tuple._2.isEmpty())
.forEach(tuple -> tuple._1.recoverTicks(tuple._2));
}
示例3: create
import io.vavr.collection.HashSet; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
Set<?> create(List<Object> result, DeserializationContext ctx) throws JsonMappingException {
if (io.vavr.collection.SortedSet.class.isAssignableFrom(javaType.getRawClass())) {
checkContainedTypeIsComparable(ctx, javaType.containedTypeOrUnknown(0));
return io.vavr.collection.TreeSet.ofAll((Comparator<Object> & Serializable) (o1, o2) -> ((Comparable) o1).compareTo(o2), result);
}
if (io.vavr.collection.LinkedHashSet.class.isAssignableFrom(javaType.getRawClass())) {
return io.vavr.collection.LinkedHashSet.ofAll(result);
}
// default deserialization [...] -> Set
return HashSet.ofAll(result);
}
示例4: build
import io.vavr.collection.HashSet; //导入方法依赖的package包/类
@Override
public Set<?> build() {
return HashSet.ofAll(list);
}
示例5: of
import io.vavr.collection.HashSet; //导入方法依赖的package包/类
@Override
HashSet<?> of(Object... arr) {
return HashSet.ofAll(Arrays.asList(arr));
}
示例6: anySubTag
import io.vavr.collection.HashSet; //导入方法依赖的package包/类
/**
* Matches a tag or (grant)child tag with the given name(s), emitting all tha events that make up that tag and its content.
*/
public static SelectedSubTagProtocol anySubTag(Iterable<QName> names) {
return new SelectedSubTagProtocol(HashSet.ofAll(names));
}
示例7: keySet
import io.vavr.collection.HashSet; //导入方法依赖的package包/类
@Override
public Set<DatabaseKey> keySet() {
return HashSet.ofAll(cache.keySet());
}
示例8: widen
import io.vavr.collection.HashSet; //导入方法依赖的package包/类
public static <T> HashSetKind<T> widen(final Publisher<T> completableSet) {
return new HashSetKind<>(
HashSet.ofAll((Iterable<T>)ReactiveSeq.fromPublisher(completableSet)));
}
示例9: of
import io.vavr.collection.HashSet; //导入方法依赖的package包/类
@Override
protected Set<?> of(Object... objects) {
return HashSet.ofAll(Arrays.asList(objects));
}