/*
 * このソースコードは blanco Frameworkにより自動生成されました。
 */
package blanco.xliff.stringgroup;

/**
 * OASIS XLIFF state アトリビュートの定義済み文字列一覧をあらわします。
 */
public class BlancoXliffStateStringGroup {
    /**
     * No.1 説明:Indicates the terminating state.
     */
    public static final int FINAL = 1;

    /**
     * No.2 説明:Indicates only non-textual information needs adaptation.
     */
    public static final int NEEDS_ADAPTATION = 2;

    /**
     * No.3 説明:Indicates both text and non-textual information needs adaptation.
     */
    public static final int NEEDS_L10N = 3;

    /**
     * No.4 説明:Indicates only non-textual information needs review.
     */
    public static final int NEEDS_REVIEW_ADAPTATION = 4;

    /**
     * No.5 説明:Indicates both text and non-textual information needs review.
     */
    public static final int NEEDS_REVIEW_L10N = 5;

    /**
     * No.6 説明:Indicates that only the text of the item needs to be reviewed.
     */
    public static final int NEEDS_REVIEW_TRANSLATION = 6;

    /**
     * No.7 説明:Indicates that the item needs to be translated.
     */
    public static final int NEEDS_TRANSLATION = 7;

    /**
     * No.8 説明:Indicates that the item is new. For example, translation units that were not in a previous version of the document.
     */
    public static final int NEW = 8;

    /**
     * No.9 説明:Indicates that changes are reviewed and approved.
     */
    public static final int SIGNED_OFF = 9;

    /**
     * No.10 説明:Indicates that the item has been translated.
     */
    public static final int TRANSLATED = 10;

    /**
     * 未定義。文字列グループ以外の文字列または定数が未定義のもの。
     */
    public static final int NOT_DEFINED = -1;

    /**
     * 文字列グループに含まれる文字列であるかどうかを判定します。
     *
     * @param argCheck チェックを行いたい文字列。
     * @return 文字列グループに含まれていればture。グループに含まれない文字列であればfalse。
     */
    public boolean match(final String argCheck) {
        // No.1
        // 説明:Indicates the terminating state.
        if ("final".equals(argCheck)) {
            return true;
        }
        // No.2
        // 説明:Indicates only non-textual information needs adaptation.
        if ("needs-adaptation".equals(argCheck)) {
            return true;
        }
        // No.3
        // 説明:Indicates both text and non-textual information needs adaptation.
        if ("needs-l10n".equals(argCheck)) {
            return true;
        }
        // No.4
        // 説明:Indicates only non-textual information needs review.
        if ("needs-review-adaptation".equals(argCheck)) {
            return true;
        }
        // No.5
        // 説明:Indicates both text and non-textual information needs review.
        if ("needs-review-l10n".equals(argCheck)) {
            return true;
        }
        // No.6
        // 説明:Indicates that only the text of the item needs to be reviewed.
        if ("needs-review-translation".equals(argCheck)) {
            return true;
        }
        // No.7
        // 説明:Indicates that the item needs to be translated.
        if ("needs-translation".equals(argCheck)) {
            return true;
        }
        // No.8
        // 説明:Indicates that the item is new. For example, translation units that were not in a previous version of the document.
        if ("new".equals(argCheck)) {
            return true;
        }
        // No.9
        // 説明:Indicates that changes are reviewed and approved.
        if ("signed-off".equals(argCheck)) {
            return true;
        }
        // No.10
        // 説明:Indicates that the item has been translated.
        if ("translated".equals(argCheck)) {
            return true;
        }
        return false;
    }

    /**
     * 文字列グループに含まれる文字列であるかどうかを、大文字小文字を区別せず判定します。
     *
     * @param argCheck チェックを行いたい文字列。
     * @return 文字列グループに含まれていればture。グループに含まれない文字列であればfalse。
     */
    public boolean matchIgnoreCase(final String argCheck) {
        // No.1
        // 説明:Indicates the terminating state.
        if ("final".equalsIgnoreCase(argCheck)) {
            return true;
        }
        // No.2
        // 説明:Indicates only non-textual information needs adaptation.
        if ("needs-adaptation".equalsIgnoreCase(argCheck)) {
            return true;
        }
        // No.3
        // 説明:Indicates both text and non-textual information needs adaptation.
        if ("needs-l10n".equalsIgnoreCase(argCheck)) {
            return true;
        }
        // No.4
        // 説明:Indicates only non-textual information needs review.
        if ("needs-review-adaptation".equalsIgnoreCase(argCheck)) {
            return true;
        }
        // No.5
        // 説明:Indicates both text and non-textual information needs review.
        if ("needs-review-l10n".equalsIgnoreCase(argCheck)) {
            return true;
        }
        // No.6
        // 説明:Indicates that only the text of the item needs to be reviewed.
        if ("needs-review-translation".equalsIgnoreCase(argCheck)) {
            return true;
        }
        // No.7
        // 説明:Indicates that the item needs to be translated.
        if ("needs-translation".equalsIgnoreCase(argCheck)) {
            return true;
        }
        // No.8
        // 説明:Indicates that the item is new. For example, translation units that were not in a previous version of the document.
        if ("new".equalsIgnoreCase(argCheck)) {
            return true;
        }
        // No.9
        // 説明:Indicates that changes are reviewed and approved.
        if ("signed-off".equalsIgnoreCase(argCheck)) {
            return true;
        }
        // No.10
        // 説明:Indicates that the item has been translated.
        if ("translated".equalsIgnoreCase(argCheck)) {
            return true;
        }
        return false;
    }

    /**
     * 文字列から定数に変換します。
     *
     * 定数が未定義の場合や 与えられた文字列が文字列グループ外の場合には NOT_DEFINED を戻します。
     *
     * @param argCheck 変換を行いたい文字列。
     * @return 定数に変換後の値。
     */
    public int convertToInt(final String argCheck) {
        // No.1
        // 説明:Indicates the terminating state.
        if ("final".equals(argCheck)) {
            return FINAL;
        }
        // No.2
        // 説明:Indicates only non-textual information needs adaptation.
        if ("needs-adaptation".equals(argCheck)) {
            return NEEDS_ADAPTATION;
        }
        // No.3
        // 説明:Indicates both text and non-textual information needs adaptation.
        if ("needs-l10n".equals(argCheck)) {
            return NEEDS_L10N;
        }
        // No.4
        // 説明:Indicates only non-textual information needs review.
        if ("needs-review-adaptation".equals(argCheck)) {
            return NEEDS_REVIEW_ADAPTATION;
        }
        // No.5
        // 説明:Indicates both text and non-textual information needs review.
        if ("needs-review-l10n".equals(argCheck)) {
            return NEEDS_REVIEW_L10N;
        }
        // No.6
        // 説明:Indicates that only the text of the item needs to be reviewed.
        if ("needs-review-translation".equals(argCheck)) {
            return NEEDS_REVIEW_TRANSLATION;
        }
        // No.7
        // 説明:Indicates that the item needs to be translated.
        if ("needs-translation".equals(argCheck)) {
            return NEEDS_TRANSLATION;
        }
        // No.8
        // 説明:Indicates that the item is new. For example, translation units that were not in a previous version of the document.
        if ("new".equals(argCheck)) {
            return NEW;
        }
        // No.9
        // 説明:Indicates that changes are reviewed and approved.
        if ("signed-off".equals(argCheck)) {
            return SIGNED_OFF;
        }
        // No.10
        // 説明:Indicates that the item has been translated.
        if ("translated".equals(argCheck)) {
            return TRANSLATED;
        }

        // 該当する定数が見つかりませんでした。
        return NOT_DEFINED;
    }

    /**
     * 定数から文字列に変換します。
     *
     * 定数と対応づく文字列に変換します。
     *
     * @param argCheck 変換を行いたい文字定数。
     * @return 文字列に変換後の値。NOT_DEFINEDの場合には長さ0の文字列。
     */
    public String convertToString(final int argCheck) {
        // No.1
        // 説明:Indicates the terminating state.
        if (argCheck == FINAL) {
            return "final";
        }
        // No.2
        // 説明:Indicates only non-textual information needs adaptation.
        if (argCheck == NEEDS_ADAPTATION) {
            return "needs-adaptation";
        }
        // No.3
        // 説明:Indicates both text and non-textual information needs adaptation.
        if (argCheck == NEEDS_L10N) {
            return "needs-l10n";
        }
        // No.4
        // 説明:Indicates only non-textual information needs review.
        if (argCheck == NEEDS_REVIEW_ADAPTATION) {
            return "needs-review-adaptation";
        }
        // No.5
        // 説明:Indicates both text and non-textual information needs review.
        if (argCheck == NEEDS_REVIEW_L10N) {
            return "needs-review-l10n";
        }
        // No.6
        // 説明:Indicates that only the text of the item needs to be reviewed.
        if (argCheck == NEEDS_REVIEW_TRANSLATION) {
            return "needs-review-translation";
        }
        // No.7
        // 説明:Indicates that the item needs to be translated.
        if (argCheck == NEEDS_TRANSLATION) {
            return "needs-translation";
        }
        // No.8
        // 説明:Indicates that the item is new. For example, translation units that were not in a previous version of the document.
        if (argCheck == NEW) {
            return "new";
        }
        // No.9
        // 説明:Indicates that changes are reviewed and approved.
        if (argCheck == SIGNED_OFF) {
            return "signed-off";
        }
        // No.10
        // 説明:Indicates that the item has been translated.
        if (argCheck == TRANSLATED) {
            return "translated";
        }
        // 未定義。
        if (argCheck == NOT_DEFINED) {
            return "";
        }

        // いずれにも該当しませんでした。
        throw new IllegalArgumentException("与えられた値(" + argCheck + ")は文字列グループ[BlancoXliffState]では定義されない値です。");
    }
}
