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.lang.String |
dumpDatabaseAsString()
Dumps the type and instance names to a String for debugging
|
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
|
java.lang.String |
toString() |
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()
BeanDatabase
getAllTypes
in interface BeanDatabase
public Instance getInstance(java.lang.String type, java.lang.String instanceKey)
BeanDatabase
getInstance
in interface BeanDatabase
type
- 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)
BeanDatabase
getType
in interface BeanDatabase
type
- The non-null namelong getRevision()
public void dumpDatabase()
BeanDatabase
dumpDatabase
in interface BeanDatabase
public void dumpDatabase(java.io.PrintStream output)
BeanDatabase
dumpDatabase
in interface BeanDatabase
output
- - The non-null outut stream to write the database topublic java.lang.String dumpDatabaseAsString()
BeanDatabase
dumpDatabaseAsString
in interface BeanDatabase
public java.lang.String toString()
toString
in class java.lang.Object