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

me.redtea.carcadex.data.repo.Repo Maven / Gradle / Ivy

package me.redtea.carcadex.data.repo;

import org.jetbrains.annotations.NotNull;

import java.util.Collection;
import java.util.Optional;
import java.util.function.Predicate;

public interface Repo {
    /**
     * @return all elements of repo
     */
    Collection all();

    /**
     * @param key key of object
     * @return object by key from repo
     */
    Optional get(@NotNull K key);

    /**
     * find objects in repo by predicate
     */
    Collection find(Predicate predicate);

    /**
     * find object in repo by predicate
     */
    Optional findAny(Predicate predicate);

    void close();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy