Interface ColumnEntity


  • public interface ColumnEntity
    A column family is a NoSQL object that contains columns of related data. It is a tuple (pair) that consists of a key-value pair, where the key is mapped to a value that is a set of columns. In analogy with relational databases, a column family is as a "table", each key-value pair being a "row". Each column is a tuple (triplet) consisting of a column name, a value, and a timestamp. In a relational database table, this data would be grouped together within a table with other non-related data.
    • Method Detail

      • of

        static ColumnEntity of​(String name)
        Creates a column family instance
        Parameters:
        name - a name to column family
        Returns:
        a ColumnEntity instance
      • of

        static ColumnEntity of​(String name,
                               List<Column> columns)
        Creates a column family instance
        Parameters:
        name - a name to column family
        columns - - columns
        Returns:
        a ColumnEntity instance
        Throws:
        NullPointerException - when either name or columns are null
      • addAll

        void addAll​(List<Column> columns)
        Appends all of the columns in the column family to the end of this list.
        Parameters:
        columns - - columns to be added
        Throws:
        NullPointerException - when columns is null
      • add

        void add​(Column column)
        Appends the specified column to the end of this list
        Parameters:
        column - - column to be added
        Throws:
        NullPointerException - when column is null
      • toMap

        Map<String,​Object> toMap()
        Converts the columns to a Map where: the key is the name the column The value is the Value.get() of the map
        Returns:
        a map instance
      • getColumns

        List<Column> getColumns()
        Returns all columns from this Column Family
        Returns:
        an immutable list of columns
      • getName

        String getName()
        Column Family's name
        Returns:
        Column Family's name
      • remove

        boolean remove​(String name)
        Remove a column whose name is informed in parameter.
        Parameters:
        name - a column name
        Returns:
        if a column was removed or not
        Throws:
        NullPointerException - when column is null
      • size

        int size()
        Returns the number of elements in this list.
        Returns:
        the number of elements in this list
      • isEmpty

        boolean isEmpty()
        Returns true if the number of columns is zero otherwise false.
        Returns:
        true if there isn't elements to getColumns()
      • copy

        ColumnEntity copy()
        make copy of itself
        Returns:
        an instance copy
      • getColumnNames

        Set<String> getColumnNames()
        Returns a Set view of the names of column contained in Column Entity
        Returns:
        the keys
      • getValues

        Collection<Value> getValues()
        Returns a Collection view of the values contained in this ColumnEntity.
        Returns:
        the collection of values
      • contains

        boolean contains​(String columnName)
        Returns true if this ColumnEntity contains a column whose the name is informed
        Parameters:
        columnName - the column name
        Returns:
        true if find a column and otherwise false
      • clear

        void clear()
        Removes all Columns