This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.Objects; | |
import java.util.function.Consumer; | |
import java.util.function.Function; | |
import java.util.function.Predicate; | |
import java.util.function.Supplier; | |
public final class When { | |
private When() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//パッケージ略 | |
import java.util.function.Supplier; | |
/** | |
* クロージャテスト | |
*/ | |
public class ClosureTest { | |
/** | |
* 可変データクラス |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.function.BiFunction; | |
import java.util.function.Consumer; | |
import java.util.function.Function; | |
public class Pipeline<T, R> { | |
private final T value; | |
Object lastReturn; | |
private Pipeline(T value) { | |
this.value = value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.jetbrains.annotations.NotNull; | |
import java.util.function.Function; | |
public interface Tuple2<T1, T2> { | |
@NotNull | |
T1 t1(); | |
@NotNull | |
T2 t2(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
Function<?, ?> f = Function.identity(); | |
Object obj = new Object(); | |
// これは出来ない | |
// f.apply((?)obj); | |
//これは出来る | |
Object obj2 = captureMethod(f, obj); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import raystark.fizzbuzz.FizzBuzzRule; | |
import raystark.fizzbuzz.FizzBuzzer; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.stream.IntStream; | |
import static java.util.stream.Collectors.toList; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<!-- This module was also published with a richer model, Gradle metadata, --> | |
<!-- which should be used instead. Do not delete the following line which --> | |
<!-- is to indicate to Gradle or any Gradle module metadata file consumer --> | |
<!-- that they should prefer consuming it instead. --> | |
<!-- do_not_remove: published-with-gradle-metadata --> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>raystark.eflib</groupId> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import raystark.eflib.exhandler.Try2; | |
public class SampleTry2 { | |
//チェック例外型 | |
static class LargerThan10Exception extends Exception {} | |
static class LargerThan20Exception extends Exception {} | |
static class MiddleException extends Exception {} | |
//可変データ | |
private static int value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.function.Consumer; | |
public class MethodResolveIssueSample { | |
static class NonGenericClass { | |
static <T> void f() { | |
h(NonGenericClass::<T>methodToBeReferenced); | |
} | |
static <T> void methodToBeReferenced(T t1) {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.function.UnaryOperator; | |
public class GenericMethodReferenceIssueSample { | |
static <T> T genericMethod(T t) { | |
return t; | |
} | |
static <T> UnaryOperator<T> of(UnaryOperator<T> t) { | |
return t; | |
} |
OlderNewer