Enum Class Extension

java.lang.Object
java.lang.Enum<Extension>
io.github.mbenincasa.javaexcelutils.enums.Extension
All Implemented Interfaces:
Serializable, Comparable<Extension>, java.lang.constant.Constable

public enum Extension extends Enum<Extension>
This Enum defines the file extensions supported by the library.
Since:
0.1.0
Author:
Mirko Benincasa
  • Enum Constant Details

    • XLS

      public static final Extension XLS
      This extension is used for a Microsoft Office spreadsheet up to version 2003
    • XLSX

      public static final Extension XLSX
      This extension is used for a Microsoft Office spreadsheet from version 2007 onwards
    • CSV

      public static final Extension CSV
      This extension is used for CSV (Comma-separated values) files
    • JSON

      public static final Extension JSON
      Since:
      0.4.0 This extension is used for JSON (JavaScript Object Notation) files
  • Method Details

    • values

      public static Extension[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Extension valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getExcelExtension

      public static Extension getExcelExtension(String ext) throws ExtensionNotValidException
      This method retrieves the Enum value based on the extension name provided as input
      Parameters:
      ext - the name of an Excel file extension to search for
      Returns:
      The Enum value that matches the name provided as input and is of type Excel
      Throws:
      ExtensionNotValidException - if no Enum value is found
    • isExcelExtension

      public Boolean isExcelExtension()
      Returns:
      true if it has type EXCEL
      Since:
      0.1.1