io.vavr.collection.HashSet.map()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(172)

本文整理了Java中io.vavr.collection.HashSet.map()方法的一些代码示例,展示了HashSet.map()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HashSet.map()方法的具体详情如下:
包路径:io.vavr.collection.HashSet
类名称:HashSet
方法名:map

HashSet.map介绍

暂无

代码示例

代码示例来源:origin: resilience4j/resilience4j

@Test
public void testExportsCircuitBreakerStates() {
  // Given
  final CollectorRegistry registry = new CollectorRegistry();
  final Bulkhead bulkhead = Bulkhead.ofDefaults("foo");
  BulkheadExports.ofIterable("boo_bulkhead", singletonList(bulkhead)).register(registry);
  final Supplier<Map<String, Double>> values = () -> HashSet
      .of("available_concurrent_calls")
      .map(param ->
          Tuple.of(param, registry.getSampleValue(
              "boo_bulkhead",
              new String[]{"name", "param"},
              new String[]{"foo", param})))
      .toMap(t -> t);
  // When
  final Map<String, Double> initialValues = values.get();
  // Then
  assertThat(initialValues).isEqualTo(HashMap.of("available_concurrent_calls", 25.0));
}

代码示例来源:origin: resilience4j/resilience4j

@Test
public void testExportsRateLimiterMetrics() {
  // Given
  final CollectorRegistry registry = new CollectorRegistry();
  final RateLimiter rateLimiter = RateLimiter.ofDefaults("foo");
  RateLimiterExports.ofIterable("boo_rate_limiter", singletonList(rateLimiter)).register(registry);
  final Supplier<Map<String, Double>> values = () -> HashSet
      .of("available_permissions", "waiting_threads")
      .map(param ->
          Tuple.of(param, registry.getSampleValue(
              "boo_rate_limiter",
              new String[]{"name", "param"},
              new String[]{"foo", param})))
      .toMap(t -> t);
  // When
  final Map<String, Double> initialValues = values.get();
  // Then
  assertThat(initialValues).isEqualTo(HashMap.of(
      "available_permissions", 50.0,
      "waiting_threads", 0.0
  ));
}

代码示例来源:origin: resilience4j/resilience4j

.map(state ->
  Tuple.of(state, registry.getSampleValue(
    "boo_circuit_breaker_states",

代码示例来源:origin: resilience4j/resilience4j

.map(callType ->
    Tuple.of(callType, registry.getSampleValue(
        "boo_circuit_breaker_calls",

代码示例来源:origin: com.pragmaticobjects.oo.data/data-core

@Override
public boolean process(java.util.Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
  processingEnv.getElementUtils();
  for (TypeElement annotation : annotations) {
    Manifest manifest = HashSet.of(roundEnv)
        .flatMap(env -> env.getElementsAnnotatedWith(annotation))
        .map(e -> (PackageElement) e)
        .map(e -> new ManifestFromPackageElement(e))
        .transform(ms -> new ManifestCombined(ms));
        for(Declaration<A> declaration : manifest.declarations(annotationType)) {
      task.sourceFiles(declaration, manifest, processingEnv).forEach(SourceFile::generate);
    }
  }
  return false;
}

相关文章