Added ColumnTypeMap

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widget-common-event@91463 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-02-12 14:43:47 +00:00
parent 5a0501c717
commit d17bc2837e
2 changed files with 70 additions and 0 deletions

View File

@ -0,0 +1,69 @@
package org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column;
public class ColumnTypeMap {
public static ColumnDataType getColumnDataType(String id){
if(id.compareTo(ColumnDataType.Boolean.toString())==0){
return ColumnDataType.Boolean;
} else {
if(id.compareTo(ColumnDataType.Geometry.toString())==0){
return ColumnDataType.Geometry;
} else {
if(id.compareTo(ColumnDataType.Boolean.toString())==0){
return ColumnDataType.Integer;
} else {
if(id.compareTo(ColumnDataType.Numeric.toString())==0){
return ColumnDataType.Numeric;
} else {
if(id.compareTo(ColumnDataType.Date.toString())==0){
return ColumnDataType.Date;
} else {
if(id.compareTo(ColumnDataType.Text.toString())==0){
return ColumnDataType.Text;
} else {
return null;
}
}
}
}
}
}
}
public static ColumnTypeCode getColumnTypeCode(String id){
if(id.compareTo(ColumnTypeCode.ANNOTATION.toString())==0){
return ColumnTypeCode.ANNOTATION;
} else {
if(id.compareTo(ColumnTypeCode.ATTRIBUTE.toString())==0){
return ColumnTypeCode.ATTRIBUTE;
} else {
if(id.compareTo(ColumnTypeCode.MEASURE.toString())==0){
return ColumnTypeCode.MEASURE;
} else {
if(id.compareTo(ColumnTypeCode.CODE.toString())==0){
return ColumnTypeCode.CODE;
} else {
if(id.compareTo(ColumnTypeCode.CODENAME.toString())==0){
return ColumnTypeCode.CODENAME;
} else {
if(id.compareTo(ColumnTypeCode.CODEDESCRIPTION.toString())==0){
return ColumnTypeCode.CODEDESCRIPTION;
} else {
if(id.compareTo(ColumnTypeCode.DIMENSION.toString())==0){
return ColumnTypeCode.DIMENSION;
} else {
if(id.compareTo(ColumnTypeCode.TIMEDIMENSION.toString())==0){
return ColumnTypeCode.TIMEDIMENSION;
} else {
return null;
}
}
}
}
}
}
}
}
}
}