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

net.anotheria.extensions.php.MappersRegistry Maven / Gradle / Ivy

There is a newer version: 4.0.3
Show newest version
package net.anotheria.extensions.php;

import net.anotheria.extensions.php.mappers.Mapper;

import java.util.HashMap;

/**
 * Registry to store stats mappers by their id.
 * Loads it data from plugin configuration
 */
class MappersRegistry {

    private HashMap registeredMappers = new HashMap<>();

    /**
     * Registers new mapper
     * @param mapperId new mapper id
     * @param mapper mapper instance
     */
    void registerMapper(String mapperId, Mapper mapper) {
        registeredMappers.put(mapperId, mapper);
    }

    /**
     * Returns mapper by it id
     * @param mapperId id of mapper
     * @return mapper instance or null if no mapper with such id exists
     */
    Mapper getMapper(String mapperId) {
        return registeredMappers.get(mapperId);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy