All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bklab.flow.util.function.EmptyFunctions Maven / Gradle / Ivy

There is a newer version: 22.0.1
Show newest version
package org.bklab.flow.util.function;

import java.util.function.*;

@SuppressWarnings({"unchecked", "rawtypes"})
public class EmptyFunctions {
    private static final Consumer EMPTY_CONSUMER = a -> {
    };
    private static final Function EMPTY_FUNCTION = a -> a;
    private static final Supplier EMPTY_SUPPLIER = () -> null;
    private static final BiConsumer EMPTY_BI_CONSUMER = (a, b) -> {
    };
    private static final BiFunction FIRST_BI_FUNCTION = (a, b) -> a;
    private static final BiFunction LAST_BI_FUNCTION = (a, b) -> b;

    public static  Consumer emptyConsumer() {
        return (Consumer) EMPTY_CONSUMER;
    }

    public static  Function emptyFunction() {
        return (Function) EMPTY_FUNCTION;
    }

    public static  Supplier emptySupplier() {
        return (Supplier) EMPTY_SUPPLIER;
    }

    public static  BiConsumer emptyBiConsumer() {
        return (BiConsumer) EMPTY_BI_CONSUMER;
    }

    public static  BiFunction firstBiFunction() {
        return (BiFunction) FIRST_BI_FUNCTION;
    }

    public static  BiFunction lastBiFunction() {
        return (BiFunction) LAST_BI_FUNCTION;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy