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

sdmxdl.file.spi.FileContext Maven / Gradle / Ivy

The newest version!
package sdmxdl.file.spi;

import lombok.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import sdmxdl.DataRepository;
import sdmxdl.ErrorListener;
import sdmxdl.EventListener;
import sdmxdl.ext.Cache;
import sdmxdl.ext.Persistence;
import sdmxdl.file.FileSource;

import java.util.List;

@lombok.Value
@lombok.Builder(toBuilder = true)
public class FileContext {

    @lombok.Builder.Default
    @NonNull FileCaching caching = FileCaching.noOp();

    @Nullable EventListener onEvent;

    @Nullable ErrorListener onError;

    @lombok.Singular
    @NonNull List persistences;

    public @NonNull Cache getReaderCache(@NonNull FileSource source) {
        return caching.getReaderCache(source, persistences, onEvent, onError);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy