Package com.gengoai

Class Registry<T extends EnumValue>

    • Constructor Detail

      • Registry

        public Registry​(SerializableFunction<String,​T> newInstance,
                        Class<T> owner)
        Instantiates a new Registry.
        Parameters:
        newInstance - the new instance
        owner - the owner
    • Method Detail

      • checkName

        protected String checkName​(CharSequence name)
        Checks the name to make sure it is valid.
        Parameters:
        name - the name
      • contains

        public boolean contains​(String name)
      • make

        public T make​(String name)
        Creates an enum value for the given name
        Parameters:
        name - the name
        Returns:
        the enum value
      • normalize

        protected String normalize​(String name)
        Normalizes the name
        Parameters:
        name - the name
        Returns:
        the normalized name
      • valueOf

        public T valueOf​(String name)
        Returns the enum value for a given name throwing an exception if it does not exist.
        Parameters:
        name - the name
        Returns:
        the enum value
      • values

        public Collection<T> values()
        Gets all know enum values as a collection
        Returns:
        the collection