All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.artifact.protocol.convert.JavaConvert Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
package org.artifact.protocol.convert;

import java.util.List;
import java.util.Map;

public class JavaConvert extends AbstractConvert {

	@Override
	protected String doConvert(String classPath,String protocolType, boolean baseType) {
		String convertType = ""; 
		switch (protocolType) {
		case "byte":
			convertType = baseType ? byte.class.getName() : Byte.class.getName();
			break;
		case "short":
			convertType = baseType ? short.class.getName() : Short.class.getName();
			break;
		case "int":
			convertType = baseType ? int.class.getName() : Integer.class.getName();
			break;
		case "long":
			convertType = baseType ? long.class.getName() : Long.class.getName();
			break;
		case "float":
			convertType = baseType ? float.class.getName() : Float.class.getName();
			break;
		case "double":
			convertType = baseType ? double.class.getName() : Double.class.getName();
			break;
		case "boolean":
			convertType = baseType ? boolean.class.getName() : Boolean.class.getName();
			break;
		case "char":
			convertType = baseType ? char.class.getName() : Character.class.getName();
			break;
		case "string":
		case "String":
			convertType = String.class.getName();
			break;
		case "map":
			convertType = Map.class.getName();
			break;
		case "list":
			convertType = List.class.getName();
			break;
		default:
//			convertType = classPath+"."+protocolType;
			convertType = protocolType;
			break;
		}
		return convertType;
	}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy