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 theParser
class.
-
-
Constructor Summary
Constructors Constructor Description Schema()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Database
getDatabase()
Returns the singleDatabase
instance of the schema, mapping to thedatabase
element of the JSON schema file.void
setDatabase(Database database)
Sets the value of theDatabase
instance, 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 singleDatabase
instance of the schema, mapping to thedatabase
element of the JSON schema file.
-
setDatabase
public void setDatabase(Database database)
Sets the value of theDatabase
instance, 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:
stream
in interfaceStreamable
-
-