丰富函数式编程接口。
parent
0e2c52b717
commit
ffe077bf5e
|
@ -0,0 +1,8 @@
|
|||
package xyz.zhouxy.plusone.commons.function;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.function.DoubleFunction;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface DoubleToOptionalFunction<R> extends DoubleFunction<Optional<R>> {
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package xyz.zhouxy.plusone.commons.function;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.function.IntFunction;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface IntToOptionalFunction<R> extends IntFunction<Optional<R>> {
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package xyz.zhouxy.plusone.commons.function;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface LongToOptionalFunction<R> extends LongFunction<Optional<R>> {
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package xyz.zhouxy.plusone.commons.function;
|
||||
|
||||
import java.util.OptionalDouble;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface OptionalDoubleSupplier extends Supplier<OptionalDouble> {
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package xyz.zhouxy.plusone.commons.function;
|
||||
|
||||
import java.util.OptionalInt;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface OptionalIntSupplier extends Supplier<OptionalInt> {
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package xyz.zhouxy.plusone.commons.function;
|
||||
|
||||
import java.util.OptionalLong;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface OptionalLongSupplier extends Supplier<OptionalLong> {
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package xyz.zhouxy.plusone.commons.function;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface OptionalSupplier<T> extends Supplier<Optional<T>> {
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package xyz.zhouxy.plusone.commons.function;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface ToOptionalBiFunction<T, U, R> extends BiFunction<T, U, Optional<R>> {
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package xyz.zhouxy.plusone.commons.function;
|
||||
|
||||
import java.util.OptionalDouble;
|
||||
import java.util.function.Function;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface ToOptionalDoubleFunction<T> extends Function<T, OptionalDouble> {
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package xyz.zhouxy.plusone.commons.function;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface ToOptionalFunction<T, R> extends Function<T, Optional<R>> {
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package xyz.zhouxy.plusone.commons.function;
|
||||
|
||||
import java.util.OptionalInt;
|
||||
import java.util.function.Function;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface ToOptionalIntFunction<T> extends Function<T, OptionalInt> {
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package xyz.zhouxy.plusone.commons.function;
|
||||
|
||||
import java.util.OptionalLong;
|
||||
import java.util.function.Function;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface ToOptionalLongFunction<T> extends Function<T, OptionalLong> {
|
||||
}
|
Loading…
Reference in New Issue