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

sdmxdl.file.SdmxFileListener Maven / Gradle / Ivy

There is a newer version: 3.0.0-beta.13
Show newest version
package sdmxdl.file;

import internal.sdmxdl.SdmxListeners;
import internal.sdmxdl.FunctionalListener;
import nbbrd.design.StaticFactoryMethod;
import nbbrd.design.ThreadSafe;
import org.checkerframework.checker.nullness.qual.NonNull;

import java.util.function.BiConsumer;

@ThreadSafe
public interface SdmxFileListener {

    boolean isEnabled();

    void onFileSourceEvent(@NonNull SdmxFileSource source, @NonNull String message);

    @StaticFactoryMethod
    static @NonNull SdmxFileListener getDefault() {
        return SdmxListeners.LOG_TO_INFO;
    }

    @StaticFactoryMethod
    static @NonNull SdmxFileListener noOp() {
        return SdmxListeners.NO_OP;
    }

    @StaticFactoryMethod
    static @NonNull SdmxFileListener of(@NonNull BiConsumer listener) {
        return FunctionalListener.builder().onFile(listener).build();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy