Class DefinitionRepository


  • public class DefinitionRepository
    extends Object
    • Method Detail

      • getRepository

        public static final DefinitionRepository getRepository()
        Get or create a DefinitionRepository. This is a traditional Singleton getInstance() method with a twist ... Along with the static final instance that is used by common singletons this also uses a scoped instance. The scoped instance is something that may be used in the context of a Function or a Callable. So, when this method is used from within a call to Definition.withRepository(repo).call(...) it will return the value of repo instead of the Singleton intance. The same goes for Definition.withNewRepository(repo -> { ... }).
        Returns:
        the scoped instance if called from within withRepo/withNewRepo lambda, or the singleton instance otherwise.
      • createRepository

        public static DefinitionRepository createRepository()
        Create a new instance of the repository, without messing with the singleton
        Returns:
        a new instance
      • registerIfAbsent

        public void registerIfAbsent​(String fqcn,
                                     Supplier<io.sundr.model.TypeDef> supplier)
      • registerIfAbsent

        public void registerIfAbsent​(io.sundr.model.TypeDef definition)
      • register

        public io.sundr.model.TypeDef register​(io.sundr.model.TypeDef definition)
      • register

        public io.sundr.model.TypeDef register​(io.sundr.model.TypeDef definition,
                                               String... flags)
      • register

        public io.sundr.model.TypeDef register​(io.sundr.model.TypeDef definition,
                                               io.sundr.model.AttributeKey<Boolean>... flags)
      • getDefinitions

        public Set<io.sundr.model.TypeDef> getDefinitions​(String... flags)
      • getDefinitions

        public Set<io.sundr.model.TypeDef> getDefinitions​(io.sundr.model.AttributeKey<Boolean>... attributeKeys)
      • hasDefinition

        public boolean hasDefinition​(String fullyQualifiedName)
      • getDefinition

        public io.sundr.model.TypeDef getDefinition​(String fullyQualifiedName)
      • getDefinition

        public io.sundr.model.TypeDef getDefinition​(String fullyQualifiedName,
                                                    boolean computeIfSupplied)
      • getDefinition

        public io.sundr.model.TypeDef getDefinition​(io.sundr.model.TypeRef type)
      • getDefinitions

        public Collection<io.sundr.model.TypeDef> getDefinitions()
      • updateReferenceMap

        public void updateReferenceMap()
      • clear

        public void clear()