public class Index extends ColumnOrderedKey
Modifier and Type | Field and Description |
---|---|
protected List<Column> |
columns
Columns that the key relates to.
|
static String |
EXTENSION_INDEX_COLUMN_ORDERING |
static String |
EXTENSION_INDEX_EXTENDED_SETTING |
static String |
EXTENSION_INDEX_TYPE |
protected String |
name
Name of the key.
|
protected Table |
table
Table that the key applies to.
|
columnOrdering, extensions
Constructor and Description |
---|
Index(CandidateKey ck)
Constructor for an index for the specified candidate key.
|
Index(ForeignKey fk)
Constructor for an index for the specified foreign key.
|
Index(Table table,
boolean isUnique,
Map<String,String> extensions)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
assertSameDatastoreObject(Column col)
Utility to assert if the column is for a different table.
|
boolean |
equals(Object obj)
Equality operator.
|
String |
getColumnList()
Accessor for the column list
|
static String |
getColumnList(List<Column> cols)
Method to return the list of columns which the key applies to.
|
List<Column> |
getColumns()
Accessor for the columns that the key relates to.
|
String |
getName()
Accessor for the key name.
|
Table |
getTable()
Accessor for the table
|
boolean |
getUnique()
Accessor for whether the index is unique
|
int |
hashCode()
Hashcode operator.
|
protected static void |
setMinSize(List list,
int size) |
void |
setName(String name)
Mutator for the key name.
|
String |
toString()
Stringify method.
|
addColumn, getColumnList, getValueForExtension, setColumn, setColumnOrdering
public static final String EXTENSION_INDEX_EXTENDED_SETTING
public static final String EXTENSION_INDEX_TYPE
public static final String EXTENSION_INDEX_COLUMN_ORDERING
protected String name
protected Table table
public Index(Table table, boolean isUnique, Map<String,String> extensions)
table
- The tableisUnique
- Whether the index is uniqueextensions
- Any extensions for the indexpublic Index(CandidateKey ck)
ck
- Candidate key to use as a basispublic Index(ForeignKey fk)
fk
- Foreign key to use as a basispublic boolean getUnique()
public int hashCode()
public boolean equals(Object obj)
obj
- Object to compare againstpublic String toString()
public void setName(String name)
name
- The key namepublic String getName()
public Table getTable()
public List<Column> getColumns()
public String getColumnList()
protected void assertSameDatastoreObject(Column col)
col
- The column to compare withprotected static void setMinSize(List list, int size)
Copyright © 2019. All rights reserved.