Package jakarta.nosql.column
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ColumnEntity.ColumnEntityProvider
A provider ofColumnEntity
where it will return from the column entity name.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(Column column)
Appends the specified column to the end of this listvoid
add(String name, Value value)
add a column withinColumnEntity
void
add(String name, Object value)
add a column withinColumnEntity
void
addAll(List<Column> columns)
Appends all of the columns in the column family to the end of this list.void
clear()
Removes all Columnsboolean
contains(String columnName)
Returns true if this ColumnEntity contains a column whose the name is informedColumnEntity
copy()
make copy of itselfOptional<Column>
find(String columnName)
Find column a column from columnNameSet<String>
getColumnNames()
Returns a Set view of the names of column contained in Column EntityList<Column>
getColumns()
Returns all columns from this Column FamilyString
getName()
Column Family's nameCollection<Value>
getValues()
Returns a Collection view of the values contained in this ColumnEntity.boolean
isEmpty()
Returns true if the number of columns is zero otherwise false.static ColumnEntity
of(String name)
Creates a column family instancestatic ColumnEntity
of(String name, List<Column> columns)
Creates a column family instanceboolean
remove(String name)
Remove a column whose name is informed in parameter.int
size()
Returns the number of elements in this list.Map<String,Object>
toMap()
Converts the columns to a Map where: the key is the name the column The value is theValue.get()
of the map
-
-
-
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 familycolumns
- - 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
-
add
void add(String name, Object value)
add a column withinColumnEntity
- Parameters:
name
- a name of the columnvalue
- the information of the column- Throws:
UnsupportedOperationException
- when this method is not supportedNullPointerException
- when either name or value are null
-
add
void add(String name, Value value)
add a column withinColumnEntity
- Parameters:
name
- a name of the columnvalue
- the information of the column- Throws:
UnsupportedOperationException
- when this method is not supportedNullPointerException
- when either name or value are null
-
toMap
Map<String,Object> toMap()
Converts the columns to a Map where: the key is the name the column The value is theValue.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
-
find
Optional<Column> find(String columnName)
Find column a column from columnName- Parameters:
columnName
- a column name- Returns:
- an
Optional
instance with the result - Throws:
NullPointerException
- when columnName 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
-
-