mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Java: Add some examples of functional interfaces for functions with two parameters.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
package p;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface MyFunction<T1, T2, T3> {
|
||||
T3 apply(T1 x, T2 y);
|
||||
}
|
||||
@@ -44,4 +44,16 @@ public class TypeBasedComplex<T> {
|
||||
public void set(Integer x, Function<Integer, T> f) {
|
||||
throw null;
|
||||
}
|
||||
|
||||
public Integer applyMyFunction(MyFunction<T, Integer, T> f, Integer x) {
|
||||
throw null;
|
||||
}
|
||||
|
||||
public <S1, S2> S2 applyMyFunctionGeneric(MyFunction<T, S1, S2> f, S1 x) {
|
||||
throw null;
|
||||
}
|
||||
|
||||
public <S1, S2, S3> S3 applyMyFunctionGeneric(MyFunction<S1, S2, S3> f, S1 x, S2 y) {
|
||||
throw null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user