EN · DE · RU · FR · ES

#452 : ReportOutputType.java

projectforge-business/src/main/java/org/projectforge/business/fibu/kost/reporting/ReportOutputType.java Type : Java · Rôle : Comptabilité financière · Source : projectforge-business/src/main/java/org/projectforge/business/fibu/kost/reporting/ReportOutputType.java 75 lignes · 31 code · 35 commentaires · 9 vides
Fichier source à projectforge-business/src/main/java/org/projectforge/business/fibu/kost/reporting/ReportOutputType.java contenant du code Java pour la couche Comptabilité financière.

Structure du code

Package : org.projectforge.business.fibu.kost.reporting

Énumérations : ReportOutputType

Méthodes (3) : getOrdinal, getType, getKey

Champs (1) : key

Importations : 1 package

Code source (abrégé)

package org.projectforge.business.fibu.kost.reporting;

import org.apache.commons.lang3.StringUtils;

public enum ReportOutputType
{
  PDF("pdf");

  private String key;

  /**
   * @see #ordinal()
   */
  public int getOrdinal()
  {
    return ordinal();
  }

  /**
   * @param s Clé ou valeur toString du type, p. ex. "pdf" ou "PDF".
   * @return ReportOutputType correspondant.
   * @throws UnsupportedOperationException si aucun type ne correspond.
   */
  public static ReportOutputType getType(String s)
  {
    if (StringUtils.isEmpty(s)) {
      return null;
    }
    for (ReportOutputType type : ReportOutputType.values()) {
      if (s.equals(type.toString()) || s.equals(type.getKey())) {
        return type;
      }
    }
    throw new UnsupportedOperationException("Type de rapport inconnu : '" + s + "'");
  }

  /**
   * La clé sera utilisée p. ex. pour l'i18n.
   *
   * @return
   */
  public String getKey()
  {
    return key;
  }

  ReportOutputType(String key)
  {
    this.key = key;
  }

}

Historique Git

868d6abb7 2025 -> 2026
63081666f En-têtes des fichiers source : 2024 -> 2025.
b6092df09 Copyright 2023 -> 2024
ab45d51fa Copyright 2001-2022 -> 2001-2023.
5f7ef41b8 Copyright 2021 -> 2022