package model.person.enums;

import java.util.Locale;

public enum Call {
	HERR(0), FRAU(1), DIVERS(2), UNBESTIMMT(3);

	private final int type;
	private Locale locale = null;

	private Call(int type) {
		this.type = type;
	}

	public Locale getLocale() {
		return locale;
	}

	public void setLocale(Locale locale) {
		this.locale = locale;
	}

	public int getType() {
		return type;
	}

	@Override
	public String toString() {
		if (locale == null || Locale.GERMAN.equals(locale)) {
			switch (this) {
			case HERR:
				return "Herr";
			case FRAU:
				return "Frau";
			case DIVERS:
				return "Divers";
			case UNBESTIMMT:
				return "Unbestimmt";
			}
		}

		if (locale.equals(Locale.ENGLISH)) {
			switch (this) {
			case HERR:
				return "Mr";
			case FRAU:
				return "Mrs";
			case DIVERS:
				return "divers";
			case UNBESTIMMT:
				return "unknown";
			}
		}
		return super.toString();
	}
}
