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

com.uchicom.smtp.Context Maven / Gradle / Ivy

There is a newer version: 0.1.20
Show newest version
// (c) 2016 uchicom
package com.uchicom.smtp;

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

public class Context {

	private static final Context context = new Context();
	private Context() {

	}
	public static Context singleton() {
		return context;
	}

	/** ユーザー名一覧 */
	private String[] users;
	private Map> boxMap;

	public String[] getUsers() {
		return users;
	}
	public void setUsers(String[] users) {
		this.users = users;
		boxMap = new HashMap<>();
		for (String user : users) {
			boxMap.put(user, new ArrayList());
		}
	}

	public void addMail(String user, Mail mail) {
		boxMap.get(user).add(mail);
	}
	public List getMailList(String user) {
		if (boxMap != null) {
			return boxMap.get(user);
		}
		return null;
	}
	public Map> getBoxMap() {
		return boxMap;
	}
	public void setBoxMap(Map> boxMap) {
		this.boxMap = boxMap;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy