From d17bc2837e31fd1090ad5e9bcba1a4528c971622 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Wed, 12 Feb 2014 14:43:47 +0000 Subject: [PATCH] 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 --- .../shared/tr/column/ColumnDataType.java | 1 + .../shared/tr/column/ColumnTypeMap.java | 69 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 src/main/java/org/gcube/portlets/user/td/widgetcommonevent/shared/tr/column/ColumnTypeMap.java diff --git a/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/shared/tr/column/ColumnDataType.java b/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/shared/tr/column/ColumnDataType.java index 9176a7e..3333745 100644 --- a/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/shared/tr/column/ColumnDataType.java +++ b/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/shared/tr/column/ColumnDataType.java @@ -32,4 +32,5 @@ public enum ColumnDataType { + } diff --git a/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/shared/tr/column/ColumnTypeMap.java b/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/shared/tr/column/ColumnTypeMap.java new file mode 100644 index 0000000..6fc0aae --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/shared/tr/column/ColumnTypeMap.java @@ -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; + } + } + } + } + } + } + } + } + } +}