public class BeanDatabaseImpl extends java.lang.Object implements BeanDatabase
| Modifier and Type | Field and Description |
|---|---|
private long |
revision |
private java.util.HashMap<java.lang.String,TypeImpl> |
types |
| Constructor and Description |
|---|
BeanDatabaseImpl(long revision)
Creates a new, fresh database
|
BeanDatabaseImpl(long revision,
BeanDatabase beanDatabase) |
| Modifier and Type | Method and Description |
|---|---|
void |
dumpDatabase()
Dumps the type and instance names to stderr
|
void |
dumpDatabase(java.io.PrintStream output)
Dumps the type and instance names to the given stream
|
java.util.Set<Type> |
getAllTypes()
Gets an unmodifiable set of all the types in the bean database
|
Instance |
getInstance(java.lang.String type,
java.lang.String instanceKey)
Returns the instance with the given instanceKey from the
type with the given name
|
(package private) long |
getRevision() |
Type |
getType(java.lang.String type)
Gets the type with the given name
|
private final long revision
private final java.util.HashMap<java.lang.String,TypeImpl> types
BeanDatabaseImpl(long revision)
BeanDatabaseImpl(long revision,
BeanDatabase beanDatabase)
public java.util.Set<Type> getAllTypes()
BeanDatabasegetAllTypes in interface BeanDatabasepublic Instance getInstance(java.lang.String type, java.lang.String instanceKey)
BeanDatabasegetInstance in interface BeanDatabasetype - The non-null name of the type to get the instance frominstanceKey - The non-null key of the instancepublic Type getType(java.lang.String type)
BeanDatabasegetType in interface BeanDatabasetype - The non-null namelong getRevision()
public void dumpDatabase()
BeanDatabasedumpDatabase in interface BeanDatabasepublic void dumpDatabase(java.io.PrintStream output)
BeanDatabasedumpDatabase in interface BeanDatabaseoutput - - The non-null outut stream to write the database to