package com.platform.entities;

import java.util.Date;

public enum BasedType {

	STRING("java.lang.String", String.class), INTEGER("java.lang.Integer",
			Integer.class), SHORT("java.lang.Short", Short.class), LONG(
			"java.lang.Long", Long.class), DATE("java.util.Date", Date.class);

	private String type;
	private Class<?> clazz;

	private BasedType(String type, Class<?> clazz) {
		this.type = type;
		this.clazz = clazz;
	}

	public static Class<?> getTypeClass(String type) {
		for (BasedType bt : BasedType.values()) {
			if (bt.equals(type))
				return bt.clazz;
		}
		return null;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Class<?> getClazz() {
		return clazz;
	}

	public void setClazz(Class<?> clazz) {
		this.clazz = clazz;
	}

	@Override
	public String toString() {
		return this.type;
	}

}
