001
002/*
003 * Copyright (C) 2011 Archie L. Cobbs. All rights reserved.
004 *
005 * $Id$
006 */
007
008package org.dellroad.jibxbindings.twilio.twiml;
009
010/**
011 * Specifies the language used in {@link Say} elements.
012 */
013public enum Language {
014    CA_ES(true),
015    DA_DK(true),
016    DE   (false),
017    DE_DE(true),
018    EN   (false),
019    EN_AU(true),
020    EN_CA(true),
021    EN_GB(false),
022    EN_IN(true),
023    EN_US(true),
024    ES   (false),
025    ES_ES(true),
026    ES_MX(true),
027    FI_FI(true),
028    FR   (false),
029    FR_CA(true),
030    FR_FR(true),
031    IT   (false),
032    IT_IT(true),
033    JA_JP(true),
034    KO_KR(true),
035    NB_NO(true),
036    NL_NL(true),
037    PL_PL(true),
038    PT_BR(true),
039    PT_PT(true),
040    RU_RU(true),
041    SV_SE(true),
042    ZH_CN(true),
043    ZH_HK(true),
044    ZH_TW(true);
045
046    private final boolean aliceOnly;
047
048    private Language(boolean aliceOnly) {
049        this.aliceOnly = aliceOnly;
050    }
051
052    @Override
053    public String toString() {
054        return this.name().toLowerCase().replace('_', '-');
055    }
056
057    /**
058     * Determine whether this language setting overrides the {@link Voice} setting, forcing the {@link Voice#ALICE} voice.
059     *
060     * @see <a href="http://www.twilio.com/docs/api/twiml/say">Twilio Docs - API TwiML Say</a>
061     */
062    public boolean isAliceOnly() {
063        return this.aliceOnly;
064    }
065}
066