package com.r35157.nenjim.service.registry;

import com.r35157.nenjim.component.NenjimComponent;
import com.r35157.nenjim.service.registry.valuetypes.NenjimComponentId;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/** Read-only catalogue of constructed Nenjim components. */
public interface NenjimRegistryService extends NenjimComponent {
    @NotNull
    List<NenjimComponentId> getComponentIds(
            @NotNull Class<? extends NenjimComponent> componentInterface);

    @Nullable
    <T extends NenjimComponent> T getComponent(
            @NotNull NenjimComponentId componentId,
            @NotNull Class<T> expectedInterface);
}
