/* UtilLib - Copyright (c) 2026 Vincent Calame - Exemole
 * Logiciel libre donné sous triple licence :
 * 1) selon les termes de la CeCILL V2
 * 2) selon les termes de l’EUPL V.1.1
 * 3) selon les termes de la GNU GPLv3
 * Voir le fichier licences.txt
 */


package net.mapeadores.util.date;

import java.time.format.FormatStyle;


/**
 *
 * @author Vincent Calame
 */
public interface DateConstants {

    public final static String SHORT_DATESTYLE = "short";
    public final static String MEDIUM_DATESTYLE = "medium";
    public final static String LONG_DATESTYLE = "long";
    public final static String FULL_DATESTYLE = "full";

    public static String checkDateStyle(String dateStyle) {
        switch (dateStyle) {
            case SHORT_DATESTYLE:
                return SHORT_DATESTYLE;
            case MEDIUM_DATESTYLE:
                return MEDIUM_DATESTYLE;
            case LONG_DATESTYLE:
                return LONG_DATESTYLE;
            case FULL_DATESTYLE:
                return FULL_DATESTYLE;
            default:
                throw new IllegalArgumentException("Unknown date style : " + dateStyle);
        }
    }

    public static FormatStyle getMatchingFormatStyle(String dateStyle) {
        switch (dateStyle) {
            case SHORT_DATESTYLE:
                return FormatStyle.SHORT;
            case MEDIUM_DATESTYLE:
                return FormatStyle.MEDIUM;
            case LONG_DATESTYLE:
                return FormatStyle.LONG;
            case FULL_DATESTYLE:
                return FormatStyle.FULL;
            default:
                return null;
        }
    }

}
