Class 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 the database.entities[].indices array properties in a JSON file with the structure described in Parser.
    • 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 a database.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()
        Returns the CREATE INDEX SQL statement used to create the SQLite index represented by this instance. Note that the return value of this method includes a ${TABLE_NAME} placeholder; the stream() method replaces the placeholder with the value returned by getName().
      • setDdl

        public void setDdl​(String ddl)
        Sets the CREATE INDEX SQL statement used to create the SQLite table represented by this instance. If ddl contains any ${TABLE_NAME} placeholders, they'll be included in the value returned by getDdl(), but not by that returned by stream().
        Parameters:
        ddl -
      • stream

        public Stream<String> stream()
        Returns a Stream 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 by getName().
        Specified by:
        stream in interface Streamable