Package com.nickbenn.room.model
Class View
- java.lang.Object
-
- com.nickbenn.room.model.View
-
- All Implemented Interfaces:
Streamable
public class View extends Object implements Streamable
Represents a view in a Room SQLite database schema. This will generally be read from one of the elements of thedatabase.viewsarray property in a JSON file with the structure described inParser.
-
-
Constructor Summary
Constructors Constructor Description View()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDdl()Returns theCREATE VIEWSQL statement used to create the SQLite view represented by this instance.StringgetName()Returns the name of the Room view (also the SQLite view name) that this instance represents.voidsetDdl(String ddl)Sets theCREATE VIEWSQL statement used to create the SQLite table represented by this instance.voidsetName(String name)Sets the name of the Room view (also the SQLite view name) that this instance represents.Stream<String>stream()Returns aStreamcontaining the DDL statement capable of creating the SQLite view corresponding to this instance.
-
-
-
Method Detail
-
getName
public String getName()
Returns the name of the Room view (also the SQLite view name) that this instance represents. This value will generally be read from adatabase.views[].viewNameproperty in a Room-generated JSON schema file.
-
setName
public void setName(String name)
Sets the name of the Room view (also the SQLite view name) that this instance represents.- Parameters:
name-
-
getDdl
public String getDdl()
-
setDdl
public void setDdl(String ddl)
Sets theCREATE VIEWSQL statement used to create the SQLite table represented by this instance. Ifddlcontains any${VIEW_NAME}placeholders, they'll be included in the value returned bygetDdl(), but not by that returned bystream().- Parameters:
ddl-
-
stream
public Stream<String> stream()
Returns aStreamcontaining the DDL statement capable of creating the SQLite view corresponding to this instance. As part of this process, all${VIEW_NAME}placeholders in the DDL are replaced by the value returned bygetName().- Specified by:
streamin interfaceStreamable
-
-