// Path: src/main/java/com/greensopinion/swagger/jaxrsgen/MoreObjects.java
// public class MoreObjects {
// 
// 	public static <T> T firstNonNull(T first, T second) {
// 		return first == null ? second : first;
// 	}
// }


import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.net.URI;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.greensopinion.swagger.jaxrsgen.MoreObjects;
import io.swagger.annotations.ApiModel;
				&& !clazz.getPackage().getName().startsWith("com.sun.jersey.multipart");
	}

	public static Map<String, String> calculateArrayItems(Class<?> parameterType, Type genericType) {
		Map<String, String> arrayItems;
		if (parameterType.isArray()) {
			String key = isModelClass(parameterType.getComponentType()) ? "$ref" : "type";
			arrayItems = ImmutableMap.of(key, ApiTypes.calculateTypeName(parameterType.getComponentType()));
		} else if (Collection.class.isAssignableFrom(parameterType)) {
			String key = isModelClass(typeArgument(genericType)) ? "$ref" : "type";
			arrayItems = ImmutableMap.of(key, ApiTypes.calculateTypeParameterName(genericType));
		} else {
			return null;
		}
		return arrayItems;
	}

	public static String calculateTypeName(Class<?> parameterType) {
		String typeName = typeNameByClass.get(parameterType);
		if (typeName != null) {
			return typeName;
		}
		if (parameterType.isPrimitive() || parameterType.getPackage().getName().equals("java.lang")) {
			return "string";
		}
		if (parameterType.getName().equals("com.sun.jersey.multipart.MultiPart")) {
			return "File";
		}
		ApiModel apiModel = parameterType.getAnnotation(ApiModel.class);
		typeName = apiModel == null ? null : Strings.emptyToNull(apiModel.value());
// Path: src/main/java/com/greensopinion/swagger/jaxrsgen/MoreObjects.java
// public class MoreObjects {
// 
// 	public static <T> T firstNonNull(T first, T second) {
// 		return first == null ? second : first;
// 	}
// }


// Path: src/main/java/com/greensopinion/swagger/jaxrsgen/model/ApiTypes.java
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.net.URI;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.greensopinion.swagger.jaxrsgen.MoreObjects;
import io.swagger.annotations.ApiModel;

				&& !clazz.getPackage().getName().startsWith("com.sun.jersey.multipart");
	}

	public static Map<String, String> calculateArrayItems(Class<?> parameterType, Type genericType) {
		Map<String, String> arrayItems;
		if (parameterType.isArray()) {
			String key = isModelClass(parameterType.getComponentType()) ? "$ref" : "type";
			arrayItems = ImmutableMap.of(key, ApiTypes.calculateTypeName(parameterType.getComponentType()));
		} else if (Collection.class.isAssignableFrom(parameterType)) {
			String key = isModelClass(typeArgument(genericType)) ? "$ref" : "type";
			arrayItems = ImmutableMap.of(key, ApiTypes.calculateTypeParameterName(genericType));
		} else {
			return null;
		}
		return arrayItems;
	}

	public static String calculateTypeName(Class<?> parameterType) {
		String typeName = typeNameByClass.get(parameterType);
		if (typeName != null) {
			return typeName;
		}
		if (parameterType.isPrimitive() || parameterType.getPackage().getName().equals("java.lang")) {
			return "string";
		}
		if (parameterType.getName().equals("com.sun.jersey.multipart.MultiPart")) {
			return "File";
		}
		ApiModel apiModel = parameterType.getAnnotation(ApiModel.class);
		typeName = apiModel == null ? null : Strings.emptyToNull(apiModel.value());
		return MoreObjects.firstNonNull(typeName, parameterType.getSimpleName());