org.fuwjax.oss.util.function.Functions Maven / Gradle / Ivy
/*
* Copyright (C) 2015 fuwjax.org ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.fuwjax.oss.util.function;
import java.util.function.*;
public class Functions {
public static Supplier defer(Supplier supplier){
return new Deferred<>(supplier);
}
public static UnsafeBiConsumer biConsumer(final UnsafeBiConsumer biConsumer) {
return biConsumer;
}
public static UnsafeBiFunction biFunction(final UnsafeBiFunction biFunction) {
return biFunction;
}
public static UnsafeBinaryOperator binaryOperator(final UnsafeBinaryOperator binaryOperator) {
return binaryOperator;
}
public static UnsafeBiPredicate biPredicate(final UnsafeBiPredicate biPredicate) {
return biPredicate;
}
public static UnsafeConsumer consumer(final UnsafeConsumer consumer) {
return consumer;
}
public static UnsafeIntConsumer intConsumer(final UnsafeIntConsumer intConsumer) {
return intConsumer;
}
public static UnsafeFunction function(final UnsafeFunction function) {
return function;
}
public static UnsafePredicate predicate(final UnsafePredicate predicate) {
return predicate;
}
public static UnsafeRunnable runnable(final UnsafeRunnable runnable) {
return runnable;
}
public static UnsafeSupplier supplier(final UnsafeSupplier supplier) {
return supplier;
}
public static UnsafeIntSupplier intSupplier(final UnsafeIntSupplier intSupplier) {
return intSupplier;
}
public static UnsafeUnaryOperator unaryOperator(final UnsafeUnaryOperator unaryOperator) {
return unaryOperator;
}
/* Eclipse is ridiculous about overloading generics right now... */
// public static Supplier defer(UnsafeSupplier supplier){
// return new Deferred<>(supplier);
// }
//
// public static BiConsumer biConsumer(final BiConsumer biConsumer) {
// return biConsumer;
// }
//
// public static BiFunction biFunction(final BiFunction biFunction) {
// return biFunction;
// }
//
// public static BinaryOperator binaryOperator(final BinaryOperator binaryOperator) {
// return binaryOperator;
// }
//
// public static BiPredicate biPredicate(final BiPredicate biPredicate) {
// return biPredicate;
// }
//
// public static Consumer consumer(final Consumer consumer) {
// return consumer;
// }
//
// public static Function function(final Function function) {
// return function;
// }
//
// public static IntConsumer intConsumer(final IntConsumer intConsumer) {
// return intConsumer;
// }
//
// public static IntSupplier intSupplier(final IntSupplier intSupplier) {
// return intSupplier;
// }
//
// public static Predicate predicate(final Predicate predicate) {
// return predicate;
// }
//
// public static Runnable runnable(final Runnable runnable) {
// return runnable;
// }
//
// public static Supplier supplier(final Supplier supplier) {
// return supplier;
// }
//
// public static UnaryOperator unaryOperator(final UnaryOperator unaryOperator) {
// return unaryOperator;
// }
}