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

How to use
getT1
method
in
reactor.util.function.Tuple3

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

origin: reactor/reactor-core

tmp = chainOrder.get(j);
if(tmp.getT1() == key){
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 fn3() {
  Integer[] source = new Integer[] { 1, 2, 3, 4, 5, 6, 7, 8 };
  Tuple3<Object, Object, Object> tuple = Tuples.fn3().apply(source);
  assertThat(tuple.getT1()).isEqualTo(1);
  assertThat(tuple.getT2()).isEqualTo(2);
  assertThat(tuple.getT3()).isEqualTo(3);
  assertThat(tuple)
      .isInstanceOf(Tuple8.class)
      .containsExactly(1, 2, 3, 4, 5, 6, 7, 8);
}
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: 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: 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))
      .switchIfEmpty(Mono.error(() -> new IllegalArgumentException("The clientRegistrationId could not be resolved. Please provide one")));
  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

@Test
public void whenDelayJustMono3() {
  MonoProcessor<Tuple3<Integer, Integer, Integer>> mp = MonoProcessor.create();
  StepVerifier.create(Mono.zipDelayError(Mono.just(1), Mono.just(2), Mono.just(3))
              .subscribeWith(mp))
        .then(() -> assertThat(mp.isError()).isFalse())
        .then(() -> assertThat(mp.isSuccess()).isTrue())
        .then(() -> assertThat(mp.isTerminated()).isTrue())
        .assertNext(v -> assertThat(v.getT1() == 1 && v.getT2() == 2 && v.getT3() == 3).isTrue())
        .verifyComplete();
}
origin: org.springframework/spring-web

/**
 * 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 whenMonoJust3() {
  MonoProcessor<Tuple3<Integer, Integer, Integer>> mp = MonoProcessor.create();
  StepVerifier.create(Mono.zip(Mono.just(1), Mono.just(2), Mono.just(3))
              .subscribeWith(mp))
        .then(() -> assertThat(mp.isError()).isFalse())
        .then(() -> assertThat(mp.isSuccess()).isTrue())
        .then(() -> assertThat(mp.isTerminated()).isTrue())
        .assertNext(v -> assertThat(v.getT1() == 1 && v.getT2() == 2 && v.getT3() == 3).isTrue())
        .verifyComplete();
}
origin: reactor/reactor-core

@Test
public void tupleProvidesTypeSafeMethods() {
  Tuple3<String, Long, Integer> t3 = Tuples.of("string", 1L, 10);
  assertThat(t3.getT1()).as("first value is a string").isInstanceOf(String.class);
  assertThat(t3.getT2()).as("second value is a long").isInstanceOf(Long.class);
  assertThat(t3.getT3()).as("third value is an int").isInstanceOf(Integer.class);
}
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 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: naturalprogrammer/spring-lemon

public U resetPassword(Tuple3<U, JWTClaimsSet, String> tuple) {
  
  log.debug("Resetting password ...");
  U user = tuple.getT1();
  JWTClaimsSet claims = tuple.getT2();
  String newPassword = tuple.getT3();
  
  LerUtils.ensureCredentialsUpToDate(claims, user);
  
  // sets the password
  user.setPassword(passwordEncoder.encode(newPassword));
  user.setCredentialsUpdatedMillis(System.currentTimeMillis());
  
  log.debug("Password reset.");
  
  return user;
}
origin: io.projectreactor.addons/reactor-extra

/**
 * Returns a {@link Consumer} of {@link Tuple3} that wraps a consumer of the component values of the tuple
 *
 * @param consumer the component value consumer
 * @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 wrapper consumer
 */
public static <T1, T2, T3> Consumer<Tuple3<T1, T2, T3>> consumer(Consumer3<T1, T2, T3> consumer) {
  return tuple -> consumer.accept(tuple.getT1(), tuple.getT2(), tuple.getT3());
}
origin: io.projectreactor.addons/reactor-extra

/**
 * Returns a {@link Predicate} of {@link Tuple3} that wraps a predicate of the component values of the tuple
 *
 * @param predicate the component value predicate
 * @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 wrapper predicate
 */
public static <T1, T2, T3> Predicate<Tuple3<T1, T2, T3>> predicate(Predicate3<T1, T2, T3> predicate) {
  return tuple -> predicate.test(tuple.getT1(), tuple.getT2(), tuple.getT3());
}
origin: io.projectreactor.addons/reactor-extra

/**
 * Returns a {@link Function} of {@link Tuple3} that wraps a function of the component values of the tuple
 *
 * @param function the component value function
 * @param <T1>     the type of the first value
 * @param <T2>     the type of the second value
 * @param <T3>     the type of the third value
 * @param <R>      the type of the result of the function
 * @return the wrapper function
 */
public static <T1, T2, T3, R> Function<Tuple3<T1, T2, T3>, R> function(Function3<T1, T2, T3, R> function) {
  return tuple -> function.apply(tuple.getT1(), tuple.getT2(), tuple.getT3());
}
origin: naturalprogrammer/spring-lemon

public Mono<UserDto> updateUser(ID userId, Mono<String> patch) {
  
  return Mono.zip(findUserById(userId), LecrUtils.currentUser(), patch)
    .doOnNext(this::ensureEditable)
    .map((Tuple3<U, Optional<UserDto>, String> tuple3) ->
      this.updateUser(tuple3.getT1(), tuple3.getT2(), tuple3.getT3()))
    .flatMap(userRepository::save)
    .map(user -> {
      UserDto userDto = user.toUserDto();
      userDto.setPassword(null);
      return userDto;
    });
}
origin: spring-projects/sts4

public Flux<Tuple2<IType, Double>> fuzzySearchTypes(String searchTerm, Predicate<IType> typeFilter) {
  return fuzzySearchTypes(searchTerm)
      .map(match -> Tuples.of(createType(Tuples.of(match.getT1(), match.getT2())), match.getT3()))
      .filter(t -> typeFilter == null || typeFilter.test(t.getT1()));
}
origin: akarnokd/akarnokd-misc

  public static void main(String[] args) {
    Publisher<Integer> source = Px.just(1).hide();
    Flux.zip(source, source, source).doOnNext(v -> System.out.println(v.getT1() + ", " + v.getT2() + ", " + v.getT3())).subscribe();
  }
}
reactor.util.functionTuple3getT1

Popular methods of Tuple3

  • 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
  • toString

Popular in Java

  • Finding current android device location
  • requestLocationUpdates (LocationManager)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • compareTo (BigDecimal)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Option (scala)
  • Top PhpStorm 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