2014-01-24 11:33:39 +01:00
|
|
|
package org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
2015-03-18 10:30:59 +01:00
|
|
|
* @author "Giancarlo Panichi" <a
|
|
|
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
2014-01-24 11:33:39 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
public enum ColumnDataType {
|
2015-03-18 10:30:59 +01:00
|
|
|
Boolean("Boolean"), Geometry("Geometry"), Integer("Integer"), Numeric(
|
|
|
|
"Numeric"), Date("Date"), Text("Text");
|
|
|
|
|
2014-01-24 11:33:39 +01:00
|
|
|
/**
|
|
|
|
* @param text
|
|
|
|
*/
|
|
|
|
private ColumnDataType(final String id) {
|
|
|
|
this.id = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
private final String id;
|
2015-03-18 10:30:59 +01:00
|
|
|
|
2014-01-24 11:33:39 +01:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return id;
|
|
|
|
}
|
2014-02-12 15:29:42 +01:00
|
|
|
|
2015-03-18 10:30:59 +01:00
|
|
|
public String getColumnDataTypeLabel() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param id
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public static ColumnDataType getColumnDataTypeFromId(String id) {
|
2015-03-31 19:19:01 +02:00
|
|
|
if(id==null||id.isEmpty()) return null;
|
|
|
|
|
2015-03-18 10:30:59 +01:00
|
|
|
for (ColumnDataType columnDataType : values()) {
|
|
|
|
if (columnDataType.id.compareToIgnoreCase(id) == 0) {
|
|
|
|
return columnDataType;
|
2015-02-06 10:25:59 +01:00
|
|
|
}
|
|
|
|
}
|
2015-03-18 10:30:59 +01:00
|
|
|
return null;
|
2015-02-06 10:25:59 +01:00
|
|
|
}
|
2015-03-18 10:30:59 +01:00
|
|
|
|
2014-01-24 11:33:39 +01:00
|
|
|
}
|