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

jdbi_modules.ModuleMeta Maven / Gradle / Ivy

The newest version!
package jdbi_modules;

import org.jdbi.v3.core.generic.GenericType;
import org.jetbrains.annotations.NotNull;

import java.util.Collection;
import java.util.function.Consumer;

/**
 * @param     The type the corresponding module maps to
 * @param  The type of the key the corresponding module uses
 * @since 14.04.2018
 */
public interface ModuleMeta {
    /**
     * @return the module prefix
     */
    @NotNull
    String getModulePrefix();

    /**
     * @return the module store
     */
    @NotNull
    Store getStore();

    /**
     * @param key              the key
     * @param collection       the collection
     * @param               the type of the elements of the collection
     * @param  the type of the collection
     */
    > void callSubmodule(@NotNull KeyType key, @NotNull CollectionType collection);

    /**
     * @param key              the key
     * @param collection       the collection
     * @param enricher         the consumer to apply after adding something to the collection
     * @param               the type of the elements of the collection
     * @param  the type of the collection
     */
    > void callSubmodule(@NotNull KeyType key, @NotNull CollectionType collection, Consumer enricher);

    /**
     * @param key  the key
     * @param type the class of the type expected
     * @param   the type expected
     * @return the value fetched
     */
     T callSubmodule(@NotNull KeyType key, @NotNull Class type);

    /**
     * @param key  the key
     * @param type the class of the type expected
     * @param   the type expected
     * @return the value fetched
     */
     T callSubmodule(@NotNull KeyType key, @NotNull GenericType type);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy