Class InMemoryRepository
java.lang.Object
com.github.joschi.jadconfig.repositories.InMemoryRepository
- All Implemented Interfaces:
Repository
Repository class providing access to a simple configuration repository backed by HashMap- Author:
- jschalanda
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the underlying data source when it isn't require any more.voidopen()Opens the configuration repository, e. g. create a database connection, open a file on disk for readingReads the configuration parameter name from the backing data source.intsize()
-
Constructor Details
-
InMemoryRepository
public InMemoryRepository() -
InMemoryRepository
-
-
Method Details
-
open
Description copied from interface:RepositoryOpens the configuration repository, e. g. create a database connection, open a file on disk for reading- Specified by:
openin interfaceRepository- Throws:
RepositoryException- If an error occurred while opening the data source
-
read
Description copied from interface:RepositoryReads the configuration parameter name from the backing data source. The name is specific to the underlying data source.- Specified by:
readin interfaceRepository- Parameters:
name- The parameter name- Returns:
- The value of the provided name as
String
-
close
Description copied from interface:RepositoryCloses the underlying data source when it isn't require any more.- Specified by:
closein interfaceRepository- Throws:
RepositoryException- If an error occurred while closing the underlying data source
-
size
public int size()
-