Class UserTable<TColumn extends UserColumn>

    • Field Detail

      • DEFAULT_AUTOINCREMENT

        public static boolean DEFAULT_AUTOINCREMENT
        Default id autoincrement setting
        Since:
        4.0.0
      • DEFAULT_PK_NOT_NULL

        public static boolean DEFAULT_PK_NOT_NULL
        Default primary key not null setting
        Since:
        4.0.0
    • Constructor Detail

      • UserTable

        protected UserTable​(UserColumns<TColumn> columns)
        Constructor
        Parameters:
        columns - columns
        Since:
        3.5.0
      • UserTable

        protected UserTable​(UserTable<TColumn> userTable)
        Copy Constructor
        Parameters:
        userTable - user table
        Since:
        3.3.0
    • Method Detail

      • copy

        public abstract UserTable<TColumn> copy()
        Copy the table
        Returns:
        copied table
        Since:
        3.3.0
      • getDataType

        public abstract String getDataType()
        Get the contents data type
        Returns:
        data type
        Since:
        3.2.0
      • getDataType

        protected String getDataType​(String defaultType)
        Get the contents data type from the contents or use the default
        Parameters:
        defaultType - default data type
        Returns:
        contents or default data type
        Since:
        4.0.0
      • createUserColumns

        public abstract UserColumns<TColumn> createUserColumns​(List<TColumn> columns)
        Create user columns for a subset of table columns
        Parameters:
        columns - columns
        Returns:
        user columns
        Since:
        3.5.0
      • createUserColumns

        public UserColumns<TColumn> createUserColumns​(String[] columnNames)
        Create user columns for a subset of table columns
        Parameters:
        columnNames - column names
        Returns:
        user columns
        Since:
        3.5.0
      • getUserColumns

        public UserColumns<TColumn> getUserColumns()
        Get the user columns
        Returns:
        user columns
        Since:
        3.5.0
      • getColumnIndex

        public int getColumnIndex​(String columnName)
        Get the column index of the column name
        Parameters:
        columnName - column name
        Returns:
        column index
      • getColumnNames

        public String[] getColumnNames()
        Get the array of column names
        Returns:
        column names
      • getColumnName

        public String getColumnName​(int index)
        Get the column name at the index
        Parameters:
        index - column index
        Returns:
        column name
      • getColumns

        public List<TColumn> getColumns()
        Get the list of columns
        Returns:
        columns
      • getColumns

        public List<TColumn> getColumns​(String[] columnNames)
        Get the columns from the column names
        Parameters:
        columnNames - column names
        Returns:
        columns
        Since:
        3.5.0
      • getColumn

        public TColumn getColumn​(int index)
        Get the column at the index
        Parameters:
        index - column index
        Returns:
        column
      • getColumn

        public TColumn getColumn​(String columnName)
        Get the column of the column name
        Parameters:
        columnName - column name
        Returns:
        column
      • hasColumn

        public boolean hasColumn​(String columnName)
        Check if the table has the column
        Parameters:
        columnName - column name
        Returns:
        true if has the column
        Since:
        3.0.1
      • columnCount

        public int columnCount()
        Get the column count
        Returns:
        column count
      • getTableName

        public String getTableName()
        Get the table name
        Returns:
        table name
      • setTableName

        public void setTableName​(String tableName)
        Set the table name
        Parameters:
        tableName - table name
        Since:
        3.3.0
      • hasPkColumn

        public boolean hasPkColumn()
        Check if the table has a primary key column
        Returns:
        true if has a primary key
        Since:
        3.0.1
      • getPkColumnIndex

        public int getPkColumnIndex()
        Get the primary key column index
        Returns:
        primary key column index
      • getPkColumn

        public TColumn getPkColumn()
        Get the primary key column
        Returns:
        primary key column
      • getPkColumnName

        public String getPkColumnName()
        Get the primary key column name
        Returns:
        primary key column name
      • addConstraint

        public void addConstraint​(Constraint constraint)
        Add constraint
        Parameters:
        constraint - constraint
        Since:
        3.3.0
      • addConstraints

        public void addConstraints​(Collection<Constraint> constraints)
        Add constraints
        Parameters:
        constraints - constraints
        Since:
        3.3.0
      • addConstraints

        public void addConstraints​(Constraints constraints)
        Add constraints
        Parameters:
        constraints - constraints
        Since:
        5.0.0
      • hasConstraints

        public boolean hasConstraints()
        Check if has constraints
        Returns:
        true if has constraints
        Since:
        3.3.0
      • hasConstraints

        public boolean hasConstraints​(ConstraintType type)
        Check if has constraints of the provided type
        Parameters:
        type - constraint type
        Returns:
        true if has constraints
        Since:
        5.0.0
      • getConstraints

        public Constraints getConstraints()
        Get the constraints
        Returns:
        constraints
        Since:
        5.0.0
      • getConstraints

        public List<Constraint> getConstraints​(ConstraintType type)
        Get the constraints of the provided type
        Parameters:
        type - constraint type
        Returns:
        constraints
        Since:
        3.3.0
      • clearConstraints

        public List<Constraint> clearConstraints()
        Clear the constraints
        Returns:
        cleared constraints
        Since:
        3.3.0
      • clearConstraints

        public List<Constraint> clearConstraints​(ConstraintType type)
        Clear the constraints of the provided type
        Parameters:
        type - constraint type
        Returns:
        cleared constraints
        Since:
        5.0.0
      • columnsOfType

        public List<TColumn> columnsOfType​(GeoPackageDataType type)
        Get the columns with the provided data type
        Parameters:
        type - data type
        Returns:
        columns
        Since:
        2.0.0
      • getContents

        public Contents getContents()
        Get the contents
        Returns:
        contents
        Since:
        3.2.0
      • setContents

        public void setContents​(Contents contents)
        Set the contents
        Parameters:
        contents - contents
        Since:
        3.2.0
      • validateContents

        protected void validateContents​(Contents contents)
        Validate that the set contents are valid
        Parameters:
        contents - contents
      • isPkModifiable

        public boolean isPkModifiable()
        Is the primary key modifiable
        Returns:
        true if the primary key is modifiable
        Since:
        4.0.0
      • setPkModifiable

        public void setPkModifiable​(boolean pkModifiable)
        Set if the primary key can be modified
        Parameters:
        pkModifiable - primary key modifiable flag
        Since:
        4.0.0
      • isValueValidation

        public boolean isValueValidation()
        Is value validation against column types enabled
        Returns:
        true if values are validated against column types
        Since:
        4.0.0
      • setValueValidation

        public void setValueValidation​(boolean valueValidation)
        Set if values should validated against column types
        Parameters:
        valueValidation - value validation flag
        Since:
        4.0.0
      • addColumn

        public void addColumn​(TColumn column)
        Add a new column
        Parameters:
        column - new column
        Since:
        3.3.0
      • renameColumn

        public void renameColumn​(TColumn column,
                                 String newColumnName)
        Rename a column
        Parameters:
        column - column
        newColumnName - new column name
        Since:
        3.3.0
      • renameColumn

        public void renameColumn​(String columnName,
                                 String newColumnName)
        Rename a column
        Parameters:
        columnName - column name
        newColumnName - new column name
        Since:
        3.3.0
      • renameColumn

        public void renameColumn​(int index,
                                 String newColumnName)
        Rename a column
        Parameters:
        index - column index
        newColumnName - new column name
        Since:
        3.3.0
      • dropColumn

        public void dropColumn​(TColumn column)
        Drop a column
        Parameters:
        column - column to drop
        Since:
        3.3.0
      • dropColumn

        public void dropColumn​(String columnName)
        Drop a column
        Parameters:
        columnName - column name
        Since:
        3.3.0
      • dropColumn

        public void dropColumn​(int index)
        Drop a column
        Parameters:
        index - column index
        Since:
        3.3.0
      • alterColumn

        public void alterColumn​(TColumn column)
        Alter a column
        Parameters:
        column - altered column
        Since:
        3.3.0
      • hasSchema

        public boolean hasSchema()
        Check if any columns have an in-memory data columns schema
        Returns:
        true if has a column schema
        Since:
        6.6.7