Tabnine Logo
Tuple3
Code IndexAdd Tabnine to your IDE (free)

How to use
Tuple3
in
reactor.util.function

Best Java code snippets using reactor.util.function.Tuple3 (Showing top 20 results out of 315)

origin: spring-projects/spring-framework

/**
 * Combine query params and form data for multipart form data from the body
 * of the request into a {@code Map<String, Object>} of values to use for
 * data binding purposes.
 * @param exchange the current exchange
 * @return a {@code Mono} with the values to bind
 * @see org.springframework.http.server.reactive.ServerHttpRequest#getQueryParams()
 * @see ServerWebExchange#getFormData()
 * @see ServerWebExchange#getMultipartData()
 */
public static Mono<Map<String, Object>> extractValuesToBind(ServerWebExchange exchange) {
  MultiValueMap<String, String> queryParams = exchange.getRequest().getQueryParams();
  Mono<MultiValueMap<String, String>> formData = exchange.getFormData();
  Mono<MultiValueMap<String, Part>> multipartData = exchange.getMultipartData();
  return Mono.zip(Mono.just(queryParams), formData, multipartData)
      .map(tuple -> {
        Map<String, Object> result = new TreeMap<>();
        tuple.getT1().forEach((key, values) -> addBindValue(result, key, values));
        tuple.getT2().forEach((key, values) -> addBindValue(result, key, values));
        tuple.getT3().forEach((key, values) -> addBindValue(result, key, values));
        return result;
      });
}
origin: reactor/reactor-core

@Test
public void fn3Delegate() {
  Integer[] source = new Integer[] { 1, 2, 3, 4, 5, 6, 7, 8 };
  Function<Tuple3<Integer, Integer, Integer>, Tuple3> invert = t3 -> new Tuple3<>(t3.getT3(), t3.getT2(), t3.getT1());
  Tuple3 tuple = Tuples.fn3(invert).apply(source);
  assertThat(tuple.getT1()).isEqualTo(3);
  assertThat(tuple.getT2()).isEqualTo(2);
  assertThat(tuple.getT3()).isEqualTo(1);
  assertThat((Object) tuple).isExactlyInstanceOf(Tuple3.class);
}
origin: reactor/reactor-core

  @Test
  public void sanityTestHashcode() {
    Tuple3<Integer, Integer, Integer> same = new Tuple3<>(1, 2, 3);
    Tuple3<Integer, Integer, Integer> different = new Tuple3<>(1, 2, 1);

    assertThat(full.hashCode())
        .isEqualTo(same.hashCode())
        .isNotEqualTo(different.hashCode());
  }
}
origin: reactor/reactor-core

  @Override
  public String getMessage() {
    //skip the "error has been observed" traceback if mapped traceback is empty
    synchronized (chainOrder) {
      if (chainOrder.isEmpty()) {
        return super.getMessage();
      }
      StringBuilder sb = new StringBuilder(super.getMessage()).append(
          "Error has been observed by the following operator(s):\n");
      for(Tuple3<Integer, String, Integer> t : chainOrder) {
        //noinspection ConstantConditions
        mapLine(t.getT3(), sb, t.getT2());
      }
      return sb.toString();
    }
  }
}
origin: reactor/reactor-core

tmp = chainOrder.get(j);
if(tmp.getT1() == key){
  i = tmp.getT3();
  break;
origin: reactor/reactor-core

@Test
public void mapT3() {
  Tuple3<Integer, Integer, String> base = Tuples.of(100, 200, "Foo");
  Tuple2<?,?> mapped = base.mapT3(String::length);
  assertThat(mapped).isNotSameAs(base)
           .hasSize(3)
           .containsExactly(base.getT1(), base.getT2(), 3);
}
origin: reactor/reactor-core

@Test
public void mapT2() {
  Tuple3<Integer, String, Integer> base = Tuples.of(100, "Foo", 300);
  Tuple2<?,?> mapped = base.mapT2(String::length);
  assertThat(mapped).isNotSameAs(base)
           .hasSize(3)
           .containsExactly(base.getT1(), 3, base.getT3());
}
origin: reactor/reactor-core

@Test
public void mapT1() {
  Tuple3<String, Integer, Integer> base = Tuples.of("Foo", 200, 300);
  Tuple2<?,?> mapped = base.mapT1(String::length);
  assertThat(mapped).isNotSameAs(base)
           .hasSize(3)
           .containsExactly(3, base.getT2(), base.getT3());
}
origin: reactor/reactor-core

         .doOnNext(v -> LOGGER.info(v.toString()))
         .doOnComplete(latch::countDown)
         .collectList();
    t3 -> t3.getT3() > 0, "has finalized");
assertThat(finalizeStats).areAtLeast(5, hasFinalized);
assertThat(finalizeStats).allMatch(t3 -> t3.getT2() <= 3, "max 3 windows in flight");
origin: reactor/reactor-core

@Test
public void nonPairWisePairWise() {
  Flux<Tuple2<Tuple3<Integer, String, String>, String>> f =
      Flux.zip(Flux.just(1), Flux.just("test"), Flux.just("test0"))
        .zipWith(Flux.just("test2"));
  Assert.assertTrue(f instanceof FluxZip);
  FluxZip<?, ?> s = (FluxZip<?, ?>) f;
  Assert.assertTrue(s.sources != null);
  Assert.assertTrue(s.sources.length == 2);
  Flux<Tuple2<Integer, String>> ff = f.map(t -> Tuples.of(t.getT1()
                               .getT1(),
      t.getT1()
       .getT2() + t.getT2()));
  ff.subscribeWith(AssertSubscriber.create())
   .assertValues(Tuples.of(1, "testtest2"))
   .assertComplete();
}
origin: reactor/reactor-core

             t2.getT2().get(t2.getT2().size() - 1)),
         retainedDetector.finalizedCount()))
     .doOnNext(v -> LOGGER.debug(v.toString()))
     .doOnComplete(latch::countDown)
     .collectList();
t3 -> t3.getT3() > 0, "has finalized");
origin: spring-projects/sts4

Flux<Tuple3<IJavaModuleData, ClassInfo, Double>> fuzzySearchTypes(String searchTerm) {
  Flux<Tuple3<IJavaModuleData, ClassInfo, Double>> flux = Flux.fromIterable(modules).publishOn(Schedulers.parallel())
    .flatMap(m -> Flux.fromIterable(getKnownTypeTuples(m)))
    .map(t -> Tuples.of(t.getT1(), t.getT2(), FuzzyMatcher.matchScore(searchTerm, t.getT2().name().toString())))
    .filter(t -> t.getT3() != 0.0);
  return flux;
}
origin: reactor/reactor-core

/**
 * Create a {@link Tuple3} with the given objects.
 *
 * @param t1   The first value in the tuple. Not null.
 * @param t2   The second value in the tuple. Not null.
 * @param t3   The third value in the tuple. Not null.
 * @param <T1> The type of the first value.
 * @param <T2> The type of the second value.
 * @param <T3> The type of the third value.
 * @return The new {@link Tuple3}.
 */
public static <T1, T2, T3> Tuple3<T1, T2, T3> of(T1 t1, T2 t2, T3 t3) {
  return new Tuple3<>(t1, t2, t3);
}
origin: reactor/reactor-core

@Override
public int hashCode() {
  int result = super.hashCode();
  result = 31 * result + t4.hashCode();
  return result;
}
origin: io.projectreactor/reactor-core

  @Override
  public String getMessage() {
    //skip the "error has been observed" traceback if mapped traceback is empty
    synchronized (chainOrder) {
      if (chainOrder.isEmpty()) {
        return super.getMessage();
      }
      StringBuilder sb = new StringBuilder(super.getMessage()).append(
          "Error has been observed by the following operator(s):\n");
      for(Tuple3<Integer, String, Integer> t : chainOrder) {
        //noinspection ConstantConditions
        mapLine(t.getT3(), sb, t.getT2());
      }
      return sb.toString();
    }
  }
}
origin: io.projectreactor/reactor-core

tmp = chainOrder.get(j);
if(tmp.getT1() == key){
  i = tmp.getT3();
  break;
origin: reactor/reactor-core

/**
 * Map the 2nd part (T2) of this {@link Tuple3} into a different value and type,
 * keeping the other parts.
 *
 * @param mapper the mapping {@link Function} for the T2 part
 * @param <R> the new type for the T2 part
 * @return a new {@link Tuple3} with a different T2 value
 */
public <R> Tuple3<T1, R, T3> mapT2(Function<T2, R> mapper) {
  return new Tuple3<>(t1, mapper.apply(t2), t3);
}
origin: io.projectreactor/reactor-core

@Override
public int hashCode() {
  int result = super.hashCode();
  result = 31 * result + t4.hashCode();
  return result;
}
origin: spring-projects/spring-security

Mono<Request> createDefaultedRequest(String clientRegistrationId,
    Authentication authentication, ServerWebExchange exchange) {
  Mono<Authentication> defaultedAuthentication = Mono.justOrEmpty(authentication)
      .switchIfEmpty(currentAuthentication());
  Mono<String> defaultedRegistrationId = Mono.justOrEmpty(clientRegistrationId)
      .switchIfEmpty(Mono.justOrEmpty(this.defaultClientRegistrationId))
      .switchIfEmpty(clientRegistrationId(defaultedAuthentication));
  Mono<Optional<ServerWebExchange>> defaultedExchange = Mono.justOrEmpty(exchange)
      .switchIfEmpty(currentServerWebExchange()).map(Optional::of)
      .defaultIfEmpty(Optional.empty());
  return Mono.zip(defaultedRegistrationId, defaultedAuthentication, defaultedExchange)
      .map(t3 -> new Request(t3.getT1(), t3.getT2(), t3.getT3().orElse(null)));
}
origin: reactor/reactor-core

/**
 * Map the 1st part (T1) of this {@link Tuple3} into a different value and type,
 * keeping the other parts.
 *
 * @param mapper the mapping {@link Function} for the T1 part
 * @param <R> the new type for the T1 part
 * @return a new {@link Tuple3} with a different T1 value
 */
public <R> Tuple3<R, T2, T3> mapT1(Function<T1, R> mapper) {
  return new Tuple3<>(mapper.apply(t1), t2, t3);
}
reactor.util.functionTuple3

Javadoc

A tuple that holds three non-null values.

Most used methods

  • getT1
  • getT2
  • getT3
    Type-safe way to get the third object of this Tuples.
  • <init>
  • hashCode
  • equals
  • get
  • mapT1
    Map the 1st part (T1) of this Tuple3 into a different value and type, keeping the other parts.
  • mapT2
    Map the 2nd part (T2) of this Tuple3 into a different value and type, keeping the other parts.
  • mapT3
    Map the 3rd part (T3) of this Tuple3 into a different value and type, keeping the other parts.
  • toArray
  • toString
  • toArray,
  • toString

Popular in Java

  • Making http post requests using okhttp
  • getSystemService (Context)
  • findViewById (Activity)
  • onCreateOptionsMenu (Activity)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JCheckBox (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now