Skip to content

Instantly share code, notes, and snippets.

@RayStarkMC
Created October 8, 2020 22:11
Show Gist options
  • Save RayStarkMC/73a77c5a744c484377f87b47d6146661 to your computer and use it in GitHub Desktop.
Save RayStarkMC/73a77c5a744c484377f87b47d6146661 to your computer and use it in GitHub Desktop.
IDEAからのGistテスト
import org.jetbrains.annotations.NotNull;
import java.util.function.Function;
public interface Tuple2<T1, T2> {
@NotNull
T1 t1();
@NotNull
T2 t2();
@NotNull
default T1 left() {
return t1();
}
@NotNull
default T2 right() {
return t2();
}
<R1> Tuple2<R1, T2> mapT1(@NotNull Function<? super T1, ? extends R1> mapper);
<R2> Tuple2<T1, R2> mapT2(@NotNull Function<? super T2, ? extends R2> mapper);
static <T1, T2> Tuple2<T1, T2> of(T1 t1, T2 t2) {
return new ValueTuple2<>(t1, t2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment