丰富函数式编程接口。

feature/net-util
ZhouXY108 2023-04-23 22:44:38 +08:00
parent 0e2c52b717
commit ffe077bf5e
12 changed files with 96 additions and 0 deletions

View File

@ -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>> {
}

View File

@ -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>> {
}

View File

@ -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>> {
}

View File

@ -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> {
}

View File

@ -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> {
}

View File

@ -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> {
}

View File

@ -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>> {
}

View File

@ -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>> {
}

View File

@ -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> {
}

View File

@ -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>> {
}

View File

@ -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> {
}

View File

@ -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> {
}