T - The type of POJO represented by this classpublic class TableInfoImpl<T> extends Object implements TableInfo<T>
TableInfo class caches all the table and its field
information needed by the class ClassInfoImpl.
Note: A fake instance of this class will be created with no table
annotations for user-defined type entities. By design, the
FieldInfoImpl class will not allow any type of keys but only columns.
| Constructor and Description |
|---|
TableInfoImpl(StatementManagerImpl mgr,
ClassInfoImpl<T> cinfo,
Table table)
Instantiates a new
TableInfo object. |
TableInfoImpl(StatementManagerImpl mgr,
UDTClassInfoImpl<T> cinfo,
String name)
Instantiates a new
TableInfo object. |
| Modifier and Type | Method and Description |
|---|---|
java.util.stream.Stream<FieldInfo<T>> |
columns() |
Collection<FieldInfoImpl<T>> |
getCaseInsensitiveKeys()
Gets the case insensitive keys for the POJO in this table if any is defined.
|
ClassInfo<T> |
getClassInfo() |
Collection<FieldInfoImpl<T>> |
getClusteringKeys()
Gets the set of clustering key column fields for the POJO in this table.
|
Optional<FieldInfo<T>> |
getColumn(String name) |
FieldInfoImpl<T> |
getColumnByField(Field f)
Gets a column field for the POJO in this table given its field name.
|
FieldInfoImpl<T> |
getColumnImpl(CharSequence name)
Gets a column field for the POJO in this table given its column name.
|
Collection<FieldInfo<T>> |
getColumns() |
Collection<FieldInfoImpl<T>> |
getColumnsImpl()
Gets the set of column fields for the POJO in this table.
|
Collection<FieldInfoImpl<T>> |
getIndexes()
Gets the set of index column fields for the POJO in this table.
|
Collection<FieldInfoImpl<T>> |
getKeyspaceAndPartitionKeys()
Gets the set of keyspace and partition key column fields for the POJO in this table.
|
Collection<FieldInfoImpl<T>> |
getKeyspaceAndPrimaryKeys()
Gets the set of keyspace and primary key column fields for the POJO in this table.
|
Set<String> |
getMandatoryAndPrimaryKeyColumns()
Gets the set of mandatory and primary columns for the POJO in this table.
|
Collection<FieldInfoImpl<T>> |
getMandatoryAndPrimaryKeys()
Gets the set of mandatory and primary column fields for the POJO in this
table.
|
Collection<FieldInfoImpl<T>> |
getMultiKeys()
Gets the multi-keys for the POJO in this table if any is defined.
|
String |
getName() |
Collection<FieldInfoImpl<T>> |
getNonPrimaryKeys()
Gets the set of non-primary key column fields for the POJO in this table.
|
Class<T> |
getObjectClass() |
Collection<FieldInfoImpl<T>> |
getPartitionKeys()
Gets the set of partition key column fields for the POJO in this table.
|
FieldInfoImpl<T> |
getPrimaryKey(CharSequence name)
Gets the a primary column fields for the POJO in this table given its
column name.
|
Collection<FieldInfoImpl<T>> |
getPrimaryKeys()
Gets the set of primary column fields for the POJO in this table.
|
Table |
getTable() |
Optional<FieldInfoImpl<T>> |
getTypeKey()
Gets the type key column fields for the POJO in this table.
|
boolean |
hasCaseInsensitiveKeys()
Checks if this table defines case insensitive keys.
|
boolean |
hasCollectionColumns() |
boolean |
hasColumn(Object name)
Checks if a column is defined in this table.
|
boolean |
hasMultiKeys()
Checks if this table defines multi-keys.
|
boolean |
hasPrimaryKey(Object name)
Checks if a column is defined as a primary key in this table.
|
boolean |
isCaseInsensitiveKey(Object name)
Checks if a column is defined as a case insensitive key in this table.
|
boolean |
isLastClusteringKey(Object name)
Checks if a column is defined as the last clustering key in this table.
|
boolean |
isLastPartitionKey(Object name)
Checks if a column is defined as the last partition key in this table.
|
boolean |
isMultiKey(Object name)
Checks if a column is defined as a multi-key in this table.
|
boolean |
isNonPrimaryKeyColumn(Object name)
Checks if a column is defined as a non primary key column in this table.
|
Iterator<FieldInfo<T>> |
iterator() |
String |
toString() |
java.util.stream.Stream<UDTClassInfoImpl<?>> |
udts()
Gets all user-defined types the pojo class represented by this table is
dependent on.
|
void |
validateCollectionColumnAndValue(CharSequence name,
Object value)
Validates if a column is defined as a collection data type by the
POJO and its potential element value in this table.
|
void |
validateCollectionColumnAndValues(CharSequence name,
Iterable<?> values)
Validates if a column is defined as a collection data type by the
POJO and its potential element value in this table.
|
void |
validateColumn(Object name)
Validates if a column is defined by the POJO in this table.
|
void |
validateColumnAndValue(CharSequence name,
Object value)
Validates if a column is defined by the POJO and its potential value in
this table.
|
void |
validateColumnAndValue(CharSequence name,
Object value,
boolean optional)
Validates if a column is defined by the POJO and its potential value in
this table.
|
void |
validateColumnAndValues(CharSequence name,
Collection<?> values)
Validates if a column is defined by the POJO and its potential values in
this table.
|
void |
validateColumns(Iterable<Object> names)
Validates if specified columns are defined by the POJO in this table.
|
void |
validateColumns(Object... names)
Validates if specified columns are defined by the POJO in this table.
|
void |
validateCounterColumn(Object name)
Validates if a column is defined as a counter by the POJO in this table.
|
void |
validateKeyspaceKeyOrColumnAndValue(CharSequence name,
Object value)
Validates if a column or keyspace key is defined by the POJO as a column or as a
keyspace key and its potential value in this table.
|
void |
validateKeyspaceKeyOrPrimaryKeyOrIndexColumn(Object name)
Validates if a column is defined as either a keyspace key, a primary key, or
an index column, by the POJO in this table.
|
void |
validateListColumnAndValue(CharSequence name,
Object value)
Validates if a column is defined as the given list data type by the
POJO and its potential element value in this table.
|
void |
validateListColumnAndValues(CharSequence name,
Iterable<?> values)
Validates if a column is defined as the given list data type by the
POJO and its potential element value in this table.
|
void |
validateMapColumnAndKey(CharSequence name,
Object key)
Validates if a column is defined as a map by the POJO and its potential
mapping key in this table.
|
void |
validateMapColumnAndKeys(CharSequence name,
Iterable<?> keys)
Validates if a column is defined as a map by the POJO and its potential
mapping keys in this table.
|
void |
validateMapColumnAndKeyValue(CharSequence name,
Object key,
Object value)
Validates if a column is defined as a map by the POJO and its potential
mapping key/value in this table.
|
void |
validateMapColumnAndKeyValues(CharSequence name,
Map<?,?> mappings)
Validates if a column is defined as a map by the POJO and its potential
mapping key/value in this table.
|
void |
validateNotMandatoryOrPrimaryKeyColumn(Object name)
Validates if a column is not defined as either a mandatory or a primary
key column by the POJO in this table.
|
void |
validatePrimaryKeyOrIndexColumn(Object name)
Validates if a column is defined as either a primary key or an index column
by the POJO in this table.
|
void |
validateSetColumnAndValue(CharSequence name,
Object value)
Validates if a column is defined as the given set data type by the
POJO and its potential element value in this table.
|
void |
validateSetColumnAndValues(CharSequence name,
Iterable<?> values)
Validates if a column is defined as a set by the POJO and its potential
element value in this table.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic TableInfoImpl(StatementManagerImpl mgr, ClassInfoImpl<T> cinfo, Table table)
TableInfo object.mgr - the non-null statement managercinfo - the non-null class info for the POJOtable - the table annotation or null if there is no tableIllegalArgumentException - if unable to find getter or setter
methods for fields of if improperly annotatedpublic TableInfoImpl(StatementManagerImpl mgr, UDTClassInfoImpl<T> cinfo, String name)
TableInfo object.mgr - the non-null statement managercinfo - the non-null UDT class info for the POJOname - the non-null table nameIllegalArgumentException - if unable to find getter or setter
methods for fields of if improperly annotatedpublic Collection<FieldInfoImpl<T>> getColumnsImpl()
null set of all column fieldspublic Class<T> getObjectClass()
getObjectClass in interface TableInfo<T>TableInfo.getObjectClass()public ClassInfo<T> getClassInfo()
getClassInfo in interface TableInfo<T>TableInfo.getClassInfo()public Table getTable()
getTable in interface TableInfo<T>TableInfo.getTable()public String getName()
getName in interface TableInfo<T>TableInfo.getName()public boolean hasCollectionColumns()
hasCollectionColumns in interface TableInfo<T>TableInfo.hasCollectionColumns()public boolean hasColumn(Object name)
name - the name of the column to check if it is defined in this tabletrue if the specified column is defined in this table;
false otherwisepublic boolean hasPrimaryKey(Object name)
name - the name of the column to check if it is defined as a primary
key in this tabletrue if the specified column is defined as a primary
key in this table; false otherwisepublic boolean isLastPartitionKey(Object name)
name - the name of the column to check if it is defined as the last
partition key in this tabletrue if the specified column is defined as the last
partition key in this table; false otherwisepublic boolean isLastClusteringKey(Object name)
name - the name of the column to check if it is defined as the last
clustering key in this tabletrue if the specified column is defined as the last
clustering key in this table; false otherwisepublic boolean isMultiKey(Object name)
name - the name of the column to check if it is defined as a multi-key
in this tabletrue if the specified column is defined as a multi-key
in this table; false otherwisepublic boolean isCaseInsensitiveKey(Object name)
name - the name of the column to check if it is defined as a case
insensitive key in this tabletrue if the specified column is defined as a case
insensitive key in this table; false otherwisepublic boolean isNonPrimaryKeyColumn(Object name)
name - the name of the column to check if it is defined as a non
primary key column in this tabletrue if the specified column is defined as a non
primary key column in this table; false otherwisepublic FieldInfoImpl<T> getColumnByField(Field f)
f - the field to retrieve its column from this tablenull if not definedpublic FieldInfoImpl<T> getColumnImpl(CharSequence name)
name - the name of the column to retrieve in this tablenull if not definedpublic Collection<FieldInfo<T>> getColumns()
getColumns in interface TableInfo<T>TableInfo.getColumns()public Optional<FieldInfo<T>> getColumn(String name)
getColumn in interface TableInfo<T>TableInfo.getColumn(java.lang.String)public java.util.stream.Stream<FieldInfo<T>> columns()
columns in interface TableInfo<T>TableInfo.columns()public Collection<FieldInfoImpl<T>> getNonPrimaryKeys()
null set of all non-primary key column fieldspublic Collection<FieldInfoImpl<T>> getPartitionKeys()
null set of all partition key column fieldspublic Collection<FieldInfoImpl<T>> getKeyspaceAndPartitionKeys()
null set of all keyspace and partition key column fieldspublic Collection<FieldInfoImpl<T>> getClusteringKeys()
null set of all clustering key column fieldspublic Optional<FieldInfoImpl<T>> getTypeKey()
public Collection<FieldInfoImpl<T>> getPrimaryKeys()
null set of all primary column fieldspublic boolean hasMultiKeys()
true if this table defines multi-keys; false
otherwisepublic boolean hasCaseInsensitiveKeys()
true if this table defines case insensitive keys;
false otherwisepublic Collection<FieldInfoImpl<T>> getMultiKeys()
null set of all multi-key column fieldspublic Collection<FieldInfoImpl<T>> getCaseInsensitiveKeys()
null set of all case insensitive key column fieldspublic Collection<FieldInfoImpl<T>> getKeyspaceAndPrimaryKeys()
null set of all keyspace and primary key column fieldspublic FieldInfoImpl<T> getPrimaryKey(CharSequence name)
name - the name of the primary column to retrieve in this tablenull if
not definedpublic Collection<FieldInfoImpl<T>> getIndexes()
null set of all index column fieldspublic Collection<FieldInfoImpl<T>> getMandatoryAndPrimaryKeys()
null set of all mandatory and primary column
fieldspublic Set<String> getMandatoryAndPrimaryKeyColumns()
null set of all mandatory and primary column
namespublic void validateColumn(Object name)
name - the column name to validateNullPointerException - if name is nullIllegalArgumentException - if the specified column is not defined
by the POJOpublic void validateColumns(Iterable<Object> names)
names - the names of the column to validateNullPointerException - if any of the column names are nullIllegalArgumentException - if any of the column name are not
defined by the POJOpublic void validateColumns(Object... names)
names - the names of the column to validateNullPointerException - if any of the column names are nullIllegalArgumentException - if any of the column name are not
defined by the POJOpublic void validateNotMandatoryOrPrimaryKeyColumn(Object name)
Note: Only the column names passed as a String are
validated.
name - the column name to validateNullPointerException - if name is nullIllegalArgumentException - if the specified column is defined
by the POJO as a mandatory or a primary key columnpublic void validatePrimaryKeyOrIndexColumn(Object name)
Note: Only the column names passed as a String are
validated.
name - the column name to validateNullPointerException - if name is nullIllegalArgumentException - if the specified column is not defined
by the POJO or is not a primary key or an index columnpublic void validateKeyspaceKeyOrPrimaryKeyOrIndexColumn(Object name)
Note: Only the column names passed as a String are
validated.
name - the column name to validateNullPointerException - if name is nullIllegalArgumentException - if the specified column is not defined
by the POJO or is not a primary key or an index columnpublic void validateCounterColumn(Object name)
Note: Only the column names passed as a String are
validated.
name - the column name to validateNullPointerException - if name is nullIllegalArgumentException - if the specified column is not defined
by the POJO or is not a counter columnpublic void validateColumnAndValue(CharSequence name, Object value)
name - the column name to validatevalue - the value to validate for the columnNullPointerException - if name is nullIllegalArgumentException - if the specified column is not defined
by the POJO or if the specified value is not of the
right type or is null when the column is mandatorypublic void validateColumnAndValue(CharSequence name, Object value, boolean optional)
name - the column name to validatevalue - the value to validate for the columnoptional - true to not fail the request if the specified
column is not defined; false to fail if it is not definedNullPointerException - if name is nullIllegalArgumentException - if the specified column is not defined
by the POJO and optional is false or if
the specified value is not of the right type or is null
when the column is mandatorypublic void validateKeyspaceKeyOrColumnAndValue(CharSequence name, Object value)
name - the column or keyspace key name to validatevalue - the value to validate for the columnNullPointerException - if name is nullIllegalArgumentException - if the specified column or keyspace key is not
defined by the POJO or if the specified value is not of the
right type or is null when the column is mandatorypublic void validateColumnAndValues(CharSequence name, Collection<?> values)
name - the column name to validatevalues - the values to validate for the columnNullPointerException - if name is nullIllegalArgumentException - if the specified column is not defined
by the POJO or if any of the specified values is not of the
right type or is null when the column is mandatorypublic void validateCollectionColumnAndValue(CharSequence name, Object value)
name - the column name to validatevalue - the element value to be validated for the collectionNullPointerException - if name is nullIllegalArgumentException - if the specified column is not defined
by the POJO as a collection or if the specified value is not of the right
element type or is null when the column is mandatorypublic void validateCollectionColumnAndValues(CharSequence name, Iterable<?> values)
name - the column name to validatevalues - the element values to be validated for the listNullPointerException - if name is nullIllegalArgumentException - if the specified column is not
defined by the POJO as the collection or if any of the specified values
are not of the right element type or are null when the
column is mandatorypublic void validateListColumnAndValue(CharSequence name, Object value)
name - the column name to validatevalue - the element value to be validated for the listNullPointerException - if name is nullIllegalArgumentException - if the specified column is not defined
by the POJO as a list or if the specified value is not of the right
element type or is null when the column is mandatorypublic void validateListColumnAndValues(CharSequence name, Iterable<?> values)
name - the column name to validatevalues - the element values to be validated for the listNullPointerException - if name is nullIllegalArgumentException - if the specified column is not
defined by the POJO as the list or if any of the specified values
are not of the right element type or are null when the
column is mandatorypublic void validateSetColumnAndValue(CharSequence name, Object value)
name - the column name to validatevalue - the element value to be validated for the setNullPointerException - if name is nullIllegalArgumentException - if the specified column is not defined
by the POJO as a set or if the specified value is not of the right
element type or is null when the column is mandatorypublic void validateSetColumnAndValues(CharSequence name, Iterable<?> values)
name - the column name to validatevalues - the element values to be validated for the setNullPointerException - if name is nullIllegalArgumentException - if the specified column is not
defined by the POJO as a set or if any of the specified values are
not of the right element type or are null when the
column is mandatorypublic void validateMapColumnAndKeyValue(CharSequence name, Object key, Object value)
name - the column name to validatekey - the mapping key to be validated for the mapvalue - the mapping value to be validated for the mapNullPointerException - if name is nullIllegalArgumentException - if the specified column is not defined
by the POJO as a map or if the specified key/value are not of
the right mapping types or the value is null when the
column is mandatorypublic void validateMapColumnAndKeyValues(CharSequence name, Map<?,?> mappings)
name - the column name to validatemappings - the mappings to be validated for the mapNullPointerException - if name is nullIllegalArgumentException - if the specified column is not defined
by the POJO as a map or if the specified key/value are not of
the right mapping types or the value is null when the
column is mandatorypublic void validateMapColumnAndKey(CharSequence name, Object key)
name - the column name to validatekey - the mapping key to be validated for the mapNullPointerException - if name is nullIllegalArgumentException - if the specified column is not defined
by the POJO as a map or if the specified key is not of
the right mapping typespublic void validateMapColumnAndKeys(CharSequence name, Iterable<?> keys)
name - the column name to validatekeys - the mappings keys to be validated for the mapNullPointerException - if name is nullIllegalArgumentException - if the specified column is not defined
by the POJO as a map or if the specified keys are not of
the right mapping typespublic java.util.stream.Stream<UDTClassInfoImpl<?>> udts()
public String toString()
toString in class ObjectObject.toString()Copyright (C) 2015-2017 The Helenus Driver Project Authors.