本文整理了Java中org.jooq.lambda.tuple.Tuple
类的一些代码示例,展示了Tuple
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tuple
类的具体详情如下:
包路径:org.jooq.lambda.tuple.Tuple
类名称:Tuple
[英]A tuple.
[中]一个元组。
代码示例来源:origin: Graylog2/graylog2-server
private ImmutableSet<Pipeline> selectPipelines(InterpreterListener interpreterListener,
Set<Tuple2<String, String>> processingBlacklist,
Message message,
Set<String> initialStreamIds,
ImmutableSetMultimap<String, Pipeline> streamConnection) {
final String msgId = message.getId();
// if a message-stream combination has already been processed (is in the set), skip that execution
final Set<String> streamsIds = initialStreamIds.stream()
.filter(streamId -> !processingBlacklist.contains(tuple(msgId, streamId)))
.filter(streamConnection::containsKey)
.collect(Collectors.toSet());
final ImmutableSet<Pipeline> pipelinesToRun = streamsIds.stream()
.flatMap(streamId -> streamConnection.get(streamId).stream())
.collect(ImmutableSet.toImmutableSet());
interpreterListener.processStreams(message, pipelinesToRun, streamsIds);
log.debug("[{}] running pipelines {} for streams {}", msgId, pipelinesToRun, streamsIds);
return pipelinesToRun;
}
代码示例来源:origin: org.jooq/jool
/**
* Collect this collectable into 2 {@link Collector}s.
*/
/// @Generated("This method was generated using jOOQ-tools")
default <R1, R2, A1, A2> Tuple2<R1, R2> collect(
Collector<? super T, A1, R1> collector1,
Collector<? super T, A2, R2> collector2
) {
return collect(Tuple.collectors(collector1, collector2));
}
代码示例来源:origin: org.jooq/jool
/**
* Collect this collectable into 3 {@link Collector}s.
*/
/// @Generated("This method was generated using jOOQ-tools")
default <R1, R2, R3, A1, A2, A3> Tuple3<R1, R2, R3> collect(
Collector<? super T, A1, R1> collector1,
Collector<? super T, A2, R2> collector2,
Collector<? super T, A3, R3> collector3
) {
return collect(Tuple.collectors(collector1, collector2, collector3));
}
代码示例来源:origin: Graylog2/graylog2-server
private boolean updateStreamBlacklist(Set<Tuple2<String, String>> processingBlacklist,
Message message,
Set<String> initialStreamIds) {
boolean addedStreams = false;
for (Stream stream : message.getStreams()) {
if (!initialStreamIds.remove(stream.getId())) {
addedStreams = true;
} else {
// only add pre-existing streams to blacklist, this has the effect of only adding already processed streams,
// not newly added ones.
processingBlacklist.add(tuple(message.getId(), stream.getId()));
}
}
return addedStreams;
}
代码示例来源:origin: org.jooq/jool
/**
* Collect this collectable into 4 {@link Collector}s.
*/
/// @Generated("This method was generated using jOOQ-tools")
default <R1, R2, R3, R4, A1, A2, A3, A4> Tuple4<R1, R2, R3, R4> collect(
Collector<? super T, A1, R1> collector1,
Collector<? super T, A2, R2> collector2,
Collector<? super T, A3, R3> collector3,
Collector<? super T, A4, R4> collector4
) {
return collect(Tuple.collectors(collector1, collector2, collector3, collector4));
}
代码示例来源:origin: org.jooq/jool
/**
* Apply attribute 3 as argument to a function and return a new tuple with the substituted argument.
*/
public final <U3> Tuple5<T1, T2, U3, T4, T5> map3(Function<? super T3, ? extends U3> function) {
return Tuple.tuple(v1, v2, function.apply(v3), v4, v5);
}
代码示例来源:origin: org.jooq/jool
/**
* Get a {@link Collector} that calculates the derived <code>PERCENT_RANK()</code> function given a specific ordering.
*/
public static <T, U> Collector<T, ?, Optional<Double>> percentRankBy(U value, Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
return collectingAndThen(
Tuple.collectors(
rankBy(value, function, comparator),
count()),
t -> t.map((rank, count) -> rank.map(r -> (double) r / count))
);
}
代码示例来源:origin: org.jooq/jool
/**
* Apply attribute 4 as argument to a function and return a new tuple with the substituted argument.
*/
public final <U4> Tuple12<T1, T2, T3, U4, T5, T6, T7, T8, T9, T10, T11, T12> map4(Function<? super T4, ? extends U4> function) {
return Tuple.tuple(v1, v2, v3, function.apply(v4), v5, v6, v7, v8, v9, v10, v11, v12);
}
代码示例来源:origin: org.jooq/jool
/**
* Apply attribute 9 as argument to a function and return a new tuple with the substituted argument.
*/
public final <U9> Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, U9, T10> map9(Function<? super T9, ? extends U9> function) {
return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, function.apply(v9), v10);
}
代码示例来源:origin: org.jooq/jool
/**
* Apply attribute 11 as argument to a function and return a new tuple with the substituted argument.
*/
public final <U11> Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, U11, T12, T13, T14, T15, T16> map11(Function<? super T11, ? extends U11> function) {
return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, function.apply(v11), v12, v13, v14, v15, v16);
}
代码示例来源:origin: org.jooq/jool
/**
* Apply attribute 16 as argument to a function and return a new tuple with the substituted argument.
*/
public final <U16> Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, U16> map16(Function<? super T16, ? extends U16> function) {
return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, function.apply(v16));
}
代码示例来源:origin: org.jooq/jool
/**
* Apply attribute 4 as argument to a function and return a new tuple with the substituted argument.
*/
public final <U4> Tuple6<T1, T2, T3, U4, T5, T6> map4(Function<? super T4, ? extends U4> function) {
return Tuple.tuple(v1, v2, v3, function.apply(v4), v5, v6);
}
代码示例来源:origin: org.jooq/jool
/**
* Apply attribute 11 as argument to a function and return a new tuple with the substituted argument.
*/
public final <U11> Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, U11> map11(Function<? super T11, ? extends U11> function) {
return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, function.apply(v11));
}
代码示例来源:origin: org.jooq/jool
/**
* Apply attribute 4 as argument to a function and return a new tuple with the substituted argument.
*/
public final <U4> Tuple9<T1, T2, T3, U4, T5, T6, T7, T8, T9> map4(Function<? super T4, ? extends U4> function) {
return Tuple.tuple(v1, v2, v3, function.apply(v4), v5, v6, v7, v8, v9);
}
代码示例来源:origin: org.jooq/jool
/**
* Apply attribute 9 as argument to a function and return a new tuple with the substituted argument.
*/
public final <U9> Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, U9> map9(Function<? super T9, ? extends U9> function) {
return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, function.apply(v9));
}
代码示例来源:origin: org.jooq/jool
/**
* Apply attribute 3 as argument to a function and return a new tuple with the substituted argument.
*/
public final <U3> Tuple15<T1, T2, U3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> map3(Function<? super T3, ? extends U3> function) {
return Tuple.tuple(v1, v2, function.apply(v3), v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15);
}
代码示例来源:origin: org.jooq/jool
/**
* Apply attribute 2 as argument to a function and return a new tuple with the substituted argument.
*/
public final <U2> Tuple7<T1, U2, T3, T4, T5, T6, T7> map2(Function<? super T2, ? extends U2> function) {
return Tuple.tuple(v1, function.apply(v2), v3, v4, v5, v6, v7);
}
代码示例来源:origin: org.jooq/jool
/**
* Apply attribute 3 as argument to a function and return a new tuple with the substituted argument.
*/
public final <U3> Tuple7<T1, T2, U3, T4, T5, T6, T7> map3(Function<? super T3, ? extends U3> function) {
return Tuple.tuple(v1, v2, function.apply(v3), v4, v5, v6, v7);
}
代码示例来源:origin: org.jooq/jool
/**
* Apply attribute 2 as argument to a function and return a new tuple with the substituted argument.
*/
public final <U2> Tuple3<T1, U2, T3> map2(Function<? super T2, ? extends U2> function) {
return Tuple.tuple(v1, function.apply(v2), v3);
}
代码示例来源:origin: org.jooq/jool
/**
* Apply attribute 1 as argument to a function and return a new tuple with the substituted argument.
*/
public final <U1> Tuple5<U1, T2, T3, T4, T5> map1(Function<? super T1, ? extends U1> function) {
return Tuple.tuple(function.apply(v1), v2, v3, v4, v5);
}
内容来源于网络,如有侵权,请联系作者删除!