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[].indices
array properties in a JSON file with the structure described inParser
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDdl()
Returns theCREATE INDEX
SQL statement used to create the SQLite index represented by this instance.String
getName()
Returns the name of the Room index (also the SQLite index) that this instance represents.void
setDdl(String ddl)
Sets theCREATE INDEX
SQL statement used to create the SQLite table represented by this instance.void
setName(String name)
Returns the name of the Room index (also the SQLite index) that this instance represents.Stream<String>
stream()
Returns aStream
containing 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[].name
property 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 INDEX
SQL statement used to create the SQLite table represented by this instance. Ifddl
contains 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 aStream
containing 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:
stream
in interfaceStreamable
-
-