EN · DE · RU · FR · ES

#452: ReportOutputType.java

projectforge-business/src/main/java/org/projectforge/business/fibu/kost/reporting/ReportOutputType.java Type: Java · Role: Financial Accounting · Source: projectforge-business/src/main/java/org/projectforge/business/fibu/kost/reporting/ReportOutputType.java 75 lines · 31 code · 35 comments · 9 blank
Source code file at projectforge-business/src/main/java/org/projectforge/business/fibu/kost/reporting/ReportOutputType.java containing Java code for the Financial Accounting layer.

Code Structure

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

Enums: ReportOutputType

Methods (3): getOrdinal, getType, getKey

Fields (1): key

Imports: 1 packages

Source Code (abridged)

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 Key or toString value of the type, e. g. "pdf" or "PDF".
   * @return Matching ReportOutputType.
   * @throws UnsupportedOperationException if no type match.
   */
  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("Unknown reporting type: '" + s + "'");
  }

  /**
   * The key will be used e. g. for i18n.
   *
   * @return
   */
  public String getKey()
  {
    return key;
  }

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

}

Git History

868d6abb7 2025 -> 2026
63081666f Source file headers: 2024-> 2025.
b6092df09 Copyright 2023 -> 2024
ab45d51fa Copyright 2001-2022 -> 2001-2023.
5f7ef41b8 Copyright 2021 -> 2022