Package com.nickbenn.room.model
Class Index
- java.lang.Object
-
- com.nickbenn.room.model.Index
-
- All Implemented Interfaces:
Streamable
public class Index extends Object implements Streamable
Represents an index in a Room SQLite database schema. This will generally be read from one of thedatabase.entities[].indicesarray properties in a JSON file with the structure described inParser.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDdl()Returns theCREATE INDEXSQL statement used to create the SQLite index represented by this instance.StringgetName()Returns the name of the Room index (also the SQLite index) that this instance represents.voidsetDdl(String ddl)Sets theCREATE INDEXSQL statement used to create the SQLite table represented by this instance.voidsetName(String name)Returns the name of the Room index (also the SQLite index) 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 index (also the SQLite index) that this instance represents. This value will generally be read from adatabase.entities[].indices[].nameproperty in a Room-generated JSON schema file.
-
setName
public void setName(String name)
Returns the name of the Room index (also the SQLite index) that this instance represents.- Parameters:
name-
-
getDdl
public String getDdl()
-
setDdl
public void setDdl(String ddl)
Sets theCREATE INDEXSQL statement used to create the SQLite table represented by this instance. Ifddlcontains any${TABLE_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
-
-