package com.prolog.rdc.tms.config.enums;

import lombok.Getter;
import lombok.Setter;

/**
 *
 * 属性类型 ENUM
 *
 *
 * @version :1.0.0
 * @className: FieldTypeEnum
 * @author: kh
 * @creationTime: 2022/1/20 15:05
 * @description:
 * @modifier:
 * @modifyTime:
 * @reviseRemarks:
 */
public enum FieldTypeEnum {

	/**
	 * 数值型
	 */
	NUM(10, "数值"), STR(20, "字符"), DAT(30, "日期"), BOL(40, "布尔"), OTH(99, "其它");

	@Getter
	@Setter
	Integer code;

	@Getter
	@Setter
	String name;

	FieldTypeEnum(Integer code, String name) {
		this.code = code;
		this.name = name;
	}

	public static FieldTypeEnum get(Integer code) {
		for (FieldTypeEnum value : values()) {
			if (value.getCode().equals(code)) {
				return value;
			}
		}
		return null;
	}
}
