Interface Named

    • Method Detail

      • of

        static <T extends Named> T of​(Class<T> type,
                                      String name)
        Obtains an instance of the specified named type by name.

        This method operates by reflection. It requires a static method of(String) method to be present on the type specified. If the method does not exist an exception is thrown.

        Type Parameters:
        T - the named type
        Parameters:
        type - the named type with the of(String) method
        name - the name to find
        Returns:
        the instance of the named type
        Throws:
        IllegalArgumentException - if the specified name could not be found
      • getName

        String getName()
        Gets the unique name of the instance.

        The name contains enough information to be able to recreate the instance.

        Returns:
        the unique name