Package it.bancaditalia.oss.vtl.session
Interface MetadataRepository
-
- All Known Implementing Classes:
CSVMetadataRepository
,InMemoryMetadataRepository
,SDMXMetadataRepository
public interface MetadataRepository
A repository to contain and query all the defined domains.- Author:
- Valentino Pinna
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <S extends ValueDomainSubset<S,D>,D extends ValueDomain>
SdefineDomain(String name, Class<S> domainClass, Object param)
Creates a new domain instance and registers it inside this repository (optional operation).ValueDomainSubset<?,?>
getDomain(String name)
Returns a domain with the specified name if it exists.Collection<ValueDomainSubset<?,?>>
getValueDomains()
default MetadataRepository
init(Object... params)
Initialize thisMetadataRepository
.boolean
isDomainDefined(String name)
Checks if aValueDomainSubset
with the specified name exists.default <S extends ValueDomainSubset<S,D>,D extends ValueDomain>
SregisterDomain(String name, S domain)
Registers a new domain instance inside this repository (optional operation).
-
-
-
Method Detail
-
getValueDomains
Collection<ValueDomainSubset<?,?>> getValueDomains()
- Returns:
- a collection of all
ValueDomainSubset
s defined in thisMetadataRepository
.
-
isDomainDefined
boolean isDomainDefined(String name)
Checks if aValueDomainSubset
with the specified name exists.- Parameters:
name
- the name of the domain to check- Returns:
- true if a domain exists.
-
getDomain
ValueDomainSubset<?,?> getDomain(String name)
Returns a domain with the specified name if it exists.- Parameters:
name
- the name of the domain- Returns:
- the domain or null if none exists.
-
registerDomain
default <S extends ValueDomainSubset<S,D>,D extends ValueDomain> S registerDomain(String name, S domain)
Registers a new domain instance inside this repository (optional operation).- Type Parameters:
S
- the type of the domain- Parameters:
name
- the name of the new domaindomain
- the domain instance- Returns:
- the same domain instance.
-
defineDomain
default <S extends ValueDomainSubset<S,D>,D extends ValueDomain> S defineDomain(String name, Class<S> domainClass, Object param)
Creates a new domain instance and registers it inside this repository (optional operation).- Type Parameters:
S
- the type of the domain- Parameters:
name
- the name of the new domaindomainClass
- the class of the domainparam
- optional parameters to pass to the domain class constructor- Returns:
- the created domain instance.
-
init
default MetadataRepository init(Object... params)
Initialize thisMetadataRepository
. This method should be always called once per instance, before attempting any other operation.- Parameters:
params
- optional initialization parameters- Returns:
- this instance
-
-