Interface Named

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getName()
      Gets the unique name of the instance.
      static <T extends Named>
      T
      of​(java.lang.Class<T> type, java.lang.String name)
      Obtains an instance of the specified named type by name.
    • Method Detail

      • of

        static <T extends Named> T of​(java.lang.Class<T> type,
                                      java.lang.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:
        java.lang.IllegalArgumentException - if the specified name could not be found
      • getName

        java.lang.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