noticetypeutil.java.svn-base

来自「学习dwr+struts2+spring进行开发的好例子」· SVN-BASE 代码 · 共 62 行

SVN-BASE
62
字号
package com.szhelper.lotteryWeb.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.szhelper.lotteryWeb.Constants;

public class NoticeTypeUtil {
	private static List noticeTypeList = new ArrayList();
	private static Map<Integer, String> noticeTypeMap = new HashMap<Integer, String>();

	static {
		List<String> keys = WebConfig
				.getList(Constants.NOTICETYPES_NOTICETYPE_KEY);
		List<String> values = WebConfig
				.getList(Constants.NOTICETYPES_NOTICETYPE_VALUE);

		try {
			for (int i = 0; i < keys.size(); i++) {
				noticeTypeList.add(new NoticeType(keys.get(i), values.get(i)));
				noticeTypeMap.put(Integer.valueOf(keys.get(i)), values.get(i));
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	// === inner class
	public static class NoticeType {
		String value;
		String key;

		public NoticeType(String key, String value) {
			this.key = key;
			this.value = value;
		}

		public String getKey() {
			return key;
		}

		public String getValue() {
			return value;
		}
	}

	public static List getNoticeTypeList() {
		return noticeTypeList;
	}

	public static Map<Integer, String> getNoticeTypeMap() {
		return noticeTypeMap;
	}

	public static String getNoticeTypeDesc(Integer key) {
		return getNoticeTypeMap().get(key);
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?