package org.bimserver.shared.meta;

/******************************************************************************
 * Copyright (C) 2009-2019  BIMserver.org
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see {@literal<http://www.gnu.org/licenses/>}.
 *****************************************************************************/

import java.util.Date;
import java.util.List;
import java.util.Set;

import javax.activation.DataHandler;

public enum SimpleType {
	ENUM,
	STRING,
	LONG,
	SHORT,
	INT,
	BOOLEAN,
	FLOAT,
	DOUBLE,
	DATE,
	CLASS,
	DATAHANDLER,
	BYTEARRAY,
	LIST,
	SET,
	VOID,
	UNKNOWN;

	public static SimpleType get(Class<?> instanceClass) {
		if (instanceClass.isEnum()) {
			return ENUM;
		} else if (instanceClass == String.class) {
			return STRING;
		} else if (instanceClass == Long.class) {
			return LONG;
		} else if (instanceClass == Integer.class) {
			return SHORT;
		} else if (instanceClass == Short.class) {
			return INT;
		} else if (instanceClass == Boolean.class) {
			return BOOLEAN;
		} else if (instanceClass == Float.class) {
			return FLOAT;
		} else if (instanceClass == Double.class) {
			return DOUBLE;
		} else if (instanceClass == Date.class) {
			return DATE;
		} else if (instanceClass == DataHandler.class) {
			return DATAHANDLER;
		} else if (instanceClass == byte[].class) {
			return BYTEARRAY;
		} else if (instanceClass == List.class) {
			return LIST;
		} else if (instanceClass == Set.class) {
			return SET;
		} else if (instanceClass == Void.class) {
			return VOID;
		}
		return UNKNOWN;
	}
}

@@ -27,17 +27,19 @@
 ed.meta;
-%0A
+%0D%0A%0D
 %0A/******
@@ -110,16 +110,17 @@
 ********
+%0D
 %0A * Copy
@@ -153,20 +153,22 @@
 rver.org
+%0D
 %0A * 
+%0D
 %0A * This
@@ -231,16 +231,17 @@
 r modify
+%0D
 %0A * it u
@@ -298,16 +298,17 @@
 cense as
+%0D
 %0A * publ
@@ -365,24 +365,25 @@
 ion 3 of the
+%0D
 %0A * License,
@@ -421,20 +421,22 @@
 version.
+%0D
 %0A * 
+%0D
 %0A * This
@@ -494,16 +494,17 @@
  useful,
+%0D
 %0A * but 
@@ -561,16 +561,17 @@
 ranty of
+%0D
 %0A * MERC
@@ -627,16 +627,17 @@
  See the
+%0D
 %0A * GNU 
@@ -683,20 +683,22 @@
 details.
+%0D
 %0A * 
+%0D
 %0A * You 
@@ -765,16 +765,17 @@
  License
+%0D
 %0A * alon
@@ -849,16 +849,17 @@
 nses/%3E%7D.
+%0D
 %0A ******
@@ -930,17 +930,19 @@
 *******/
-%0A
+%0D%0A%0D
 %0Aimport 
@@ -956,16 +956,17 @@
 il.Date;
+%0D
 %0Aimport 
@@ -980,16 +980,17 @@
 il.List;
+%0D
 %0Aimport 
@@ -1003,17 +1003,19 @@
 til.Set;
-%0A
+%0D%0A%0D
 %0Aimport 
@@ -1043,16 +1043,17 @@
 Handler;
+%0D
 %0A%0D%0Apubli
@@ -1519,20 +1519,18 @@
 %09return 
-SHOR
+IN
 T;%0D%0A%09%09%7D 
@@ -1573,34 +1573,36 @@
 s) %7B%0D%0A%09%09%09return 
-IN
+SHOR
 T;%0D%0A%09%09%7D else if 

fix #1179