Package io.sundr.model.repo
Class DefinitionRepository
java.lang.Object
io.sundr.model.repo.DefinitionRepository
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()static DefinitionRepositoryCreate a new instance of the repository, without messing with the singletongetDefinition(TypeRef type) getDefinition(String fullyQualifiedName) getDefinition(String fullyQualifiedName, boolean computeIfSupplied) getDefinitions(AttributeKey<Boolean>... attributeKeys) getDefinitions(String... flags) static final DefinitionRepositoryGet or create a DefinitionRepository.booleanhasDefinition(String fullyQualifiedName) register(TypeDef definition, AttributeKey<Boolean>... flags) voidregisterIfAbsent(TypeDef definition) voidregisterIfAbsent(String fqcn, Supplier<TypeDef> supplier) voidwithRepository(DefinitionRepository repository)
-
Method Details
-
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 aFunctionor aCallable. 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
Create a new instance of the repository, without messing with the singleton- Returns:
- a new instance
-
withRepository
-
withNewRepository
-
registerIfAbsent
-
registerIfAbsent
-
register
-
register
-
register
-
getDefinitions
-
getDefinitions
-
hasDefinition
-
getDefinition
-
getDefinition
-
getDefinition
-
getDefinitions
-
updateReferenceMap
public void updateReferenceMap() -
getReferenceMap
-
clear
public void clear()
-