Interface RegistryHolder

    • Method Detail

      • registry

        <T> Registry<T> registry​(RegistryType<T> type)
        Gets the Registry by a key.

        Great care needs to be made in calling this method with any uncertainty as to if the key will exist in the holder. Should the key lack a value, a ValueNotFoundException will be thrown. Therefore, it is advised to call findRegistry(RegistryType) instead.

        Type Parameters:
        T - The type
        Parameters:
        type - The type
        Returns:
        The registry
      • findRegistry

        <T> java.util.Optional<Registry<T>> findRegistry​(RegistryType<T> type)
        Gets the Registry by a type, if found.
        Type Parameters:
        T - The type
        Parameters:
        type - The type
        Returns:
        The registry or Optional.empty()
      • streamRegistries

        java.util.stream.Stream<Registry<?>> streamRegistries​(ResourceKey root)
        Gets a Stream of the registries in this holder within a root.
        Parameters:
        root - The root to stream registries of
        Returns:
        The stream