me.redtea.carcadex.data.repo.builder.RepoBuilder Maven / Gradle / Ivy
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());
}
}