Package com.nickbenn.room.model
Class Schema
- java.lang.Object
-
- com.nickbenn.room.model.Schema
-
- All Implemented Interfaces:
Streamable
public class Schema extends Object implements Streamable
Represents the top-level database schema, as declared via Room@Entity-,@DatabaseView-, and@Database-annotated classes, and as emitted by the Room annotation processor in a JSON schema file. The structure of this class maps to the top-level object shown in the documentation of theParserclass.
-
-
Constructor Summary
Constructors Constructor Description Schema()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DatabasegetDatabase()Returns the singleDatabaseinstance of the schema, mapping to thedatabaseelement of the JSON schema file.voidsetDatabase(Database database)Sets the value of theDatabaseinstance, as read from the JSON schema file.Stream<String>stream()Returns the DDL content returned from an invocation ofgetDatabase().stream().
-
-
-
Method Detail
-
getDatabase
public Database getDatabase()
Returns the singleDatabaseinstance of the schema, mapping to thedatabaseelement of the JSON schema file.
-
setDatabase
public void setDatabase(Database database)
Sets the value of theDatabaseinstance, as read from the JSON schema file.- Parameters:
database-
-
stream
public Stream<String> stream()
Returns the DDL content returned from an invocation ofgetDatabase().stream().- Specified by:
streamin interfaceStreamable
-
-