/**
 * Copyright © 2012-2025 by Data Virtuality GmbH
 */
package com.datavirtuality.dv.core.interfaces;

import java.text.MessageFormat;
import java.util.ResourceBundle;

/**
 * @author Alexander Fischer
 * @date 2025.08.28
 */
public class BundleUtil {

    private final String pluginId;
    private final String bundleName;
    private final ResourceBundle bundle;

    public BundleUtil(String pluginId, String bundleName, ResourceBundle bundle) {
        this.pluginId = pluginId;
        this.bundleName = bundleName;
        this.bundle = bundle;
    }

    public String gs(Enum<?> event, Object... params) {
        String pattern = bundle.getString(event.name());
        return MessageFormat.format(pattern, params);
    }

    public interface Event {
        String name();
    }
}
