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

com.yahoo.maha.parrequest2.SideEffectFunction Maven / Gradle / Ivy

There is a newer version: 6.158
Show newest version
// Copyright 2017, Yahoo Holdings Inc.
// Licensed under the terms of the Apache License 2.0. Please see LICENSE file in project root for terms.
package com.yahoo.maha.parrequest2;

import java.util.function.Function;

/**
 * Used to represent side effecting functions which do not return anything, e.g. logging
 */
abstract public class SideEffectFunction implements Function {

    abstract void doSideEffect(T input);

    @Override
    final public Nothing apply(T input) {
        doSideEffect(input);
        return Nothing.get();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy