Res.java 968 Bytes
package com.huaheng.common.constant;

import java.util.ResourceBundle;

public class Res {

    private static ResourceBundle dateBundle;
    private static ResourceBundle yearBundle;
    private static ResourceBundle batteryBundle;

    private Res() {
        bundle();
    }

    private static class StringBundleHolder {
        private static Res instance = new Res();
    }

    public static Res string() {
        return StringBundleHolder.instance;
    }

    public void bundle() {
        dateBundle = ResourceBundle.getBundle("productDateRes");
        yearBundle = ResourceBundle.getBundle("productYearRes");
        batteryBundle = ResourceBundle.getBundle("batteryRes");
    }

    public String dateKey(String key) {
        return dateBundle.getString(key);
    }

    public String yearKey(String key) {
        return yearBundle.getString(key);
    }

    public String batteryKey(String key) {
        return batteryBundle.getString(key);
    }

}