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

me.redtea.carcadex.data.repo.builder.RepoBuilder Maven / Gradle / Ivy

There is a newer version: 2.0.1-BETA
Show newest version
package me.redtea.carcadex.data.repo.builder;

import me.redtea.carcadex.data.repo.MutableRepo;
import me.redtea.carcadex.data.serializer.CommonSerializer;
import me.redtea.carcadex.data.repo.builder.impl.RepoBuilderImpl;
import me.redtea.carcadex.data.schema.SchemaStrategy;

import java.io.File;
import java.nio.file.Path;
import java.util.logging.Logger;

public interface RepoBuilder {
    RepoBuilder folder(File folder);

    RepoBuilder serializer(CommonSerializer serializer);
    RepoBuilder binary(); //requires that V extends Serializable
    RepoBuilder schema(SchemaStrategy schemaStrategy);
    RepoBuilder logging();
    RepoBuilder debugLogging();
    RepoBuilder logging(Logger logger);
    RepoBuilder debugLogging(Logger logger);
    RepoBuilder autoSave(long period); //in milisec
    RepoBuilder sync();
    RepoBuilder cacheCollectionAll();
    RepoBuilder maxCacheSize(int size);
    RepoBuilder maxCacheSize(int size, float cleanFactor);
    RepoBuilder concurrent();


    MutableRepo build();

    static RepoBuilder get() {
        return new RepoBuilderImpl<>();
    }

    static  RepoBuilder of(File folder) {
        return RepoBuilder.get().folder(folder);
    }

    static  RepoBuilder of(Path folder) {
        return RepoBuilder.get().folder(folder.toFile());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy