Package app.babylon.table.column
Class ColumnName
java.lang.Object
app.babylon.table.column.ColumnName
- All Implemented Interfaces:
Comparable<ColumnName>
Canonical, case-insensitive table column name.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringReturns the canonical cleaned form of arbitrary column-name text.intbooleanReturns the canonical comparison key.getValue()Returns the exported display value of the column name.inthashCode()static ColumnNameof(CharSequence s) Creates a column name from raw text.static ColumnNameof(CharSequence s, int start, int length) static ColumnName[]Converts an array of strings into column names.static ColumnName[]Converts a tail slice of a string array into column names.static ColumnName[]of(Collection<String> v) Converts a collection of strings into column names.static ColumnNameParses a column name, returningnullfor empty text.static ColumnNameparse(CharSequence s, int start, int length) Returns the camelCase representation of the name.Returns the CamelUpper representation of the name.toSnake()Returns a snake-case representation of the name.Returns a SQL-friendly identifier for the name.toString()static String[]Converts column names back to their exported string values.toWords(Collection<String> words) Splits the name into camel-case words.
-
Method Details
-
of
Creates a column name from raw text.- Parameters:
s- source text- Returns:
- column name
-
of
-
parse
Parses a column name, returningnullfor empty text.- Parameters:
s- source text- Returns:
- parsed column name or
null
-
parse
-
of
Converts a collection of strings into column names.- Parameters:
v- source names- Returns:
- column-name array
-
of
Converts an array of strings into column names.- Parameters:
v- source names- Returns:
- column-name array
-
of
Converts a tail slice of a string array into column names.- Parameters:
v- source namesstartIndex- first index to include- Returns:
- column-name array
-
toString
-
getValue
Returns the exported display value of the column name.- Returns:
- display value
-
getCanonical
Returns the canonical comparison key.- Returns:
- canonical key
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<ColumnName>
-
toSnake
Returns a snake-case representation of the name.- Returns:
- snake-case text
-
toWords
Splits the name into camel-case words.- Parameters:
words- destination collection ornull- Returns:
- destination collection containing the words
-
toSqlIdentifier
Returns a SQL-friendly identifier for the name.- Returns:
- quoted SQL identifier
-
toCamelCaseUpper
Returns the CamelUpper representation of the name.- Returns:
- CamelUpper text
-
toCamelCase
Returns the camelCase representation of the name.- Returns:
- camelCase text
-
clean
Returns the canonical cleaned form of arbitrary column-name text.- Parameters:
s- source text- Returns:
- cleaned canonical key
-
toStringArray
Converts column names back to their exported string values.- Parameters:
x- source column names- Returns:
- string values or
null
-