Interface RegistrySpec

    • Method Detail

      • add

        default <O> RegistrySpec add​(Class<O> type,
                                     O object)
        Adds a registry entry that is available by the given type.
        Type Parameters:
        O - the public type of the registry entry
        Parameters:
        type - the public type of the registry entry
        object - the actual registry entry
        Returns:
        this
      • add

        default <O> RegistrySpec add​(com.google.common.reflect.TypeToken<O> type,
                                     O object)
        Adds a registry entry that is available by the given type.
        Type Parameters:
        O - the public type of the registry entry
        Parameters:
        type - the public type of the registry entry
        object - the actual registry entry
        Returns:
        this
      • add

        default RegistrySpec add​(Object object)
        Adds a registry entry.
        Parameters:
        object - the object to add to the registry
        Returns:
        this
      • addLazy

        default <O> RegistrySpec addLazy​(Class<O> type,
                                         Supplier<? extends O> supplier)
        Adds a lazily created entry to the registry.

        The supplier will be invoked exactly once, when a query is made to the registry of a compatible type of the given type.

        Type Parameters:
        O - the public type of the registry entry
        Parameters:
        type - the public type of the registry entry
        supplier - the supplier for creating the object when needed
        Returns:
        this
      • addLazy

        <O> RegistrySpec addLazy​(com.google.common.reflect.TypeToken<O> type,
                                 Supplier<? extends O> supplier)
        Adds a lazily created entry to the registry.

        The supplier will be invoked exactly once, when a query is made to the registry of a compatible type of the given type.

        Type Parameters:
        O - the public type of the registry entry
        Parameters:
        type - the public type of the registry entry
        supplier - the supplier for creating the object when needed
        Returns:
        this