Package com.gengoai

Class HierarchicalRegistry<T extends HierarchicalEnumValue>

    • Constructor Detail

      • HierarchicalRegistry

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

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

      • checkName

        protected void checkName​(String name)
      • ensureParent

        protected String ensureParent​(T parent,
                                      String name)
        Ensures that the non-root parent is prepended onto the enum value name
        Parameters:
        parent - the parent
        name - the name
        Returns:
        the string
      • make

        public T make​(T parent,
                      String name)
        Generates an enum value with the given parent.
        Parameters:
        parent - the parent
        name - the name of the enum value
        Returns:
        the enum value