Enum Class LoggingType

java.lang.Object
java.lang.Enum<LoggingType>
net.luis.utils.logging.LoggingType
All Implemented Interfaces:
Serializable, Comparable<LoggingType>, Constable, Iterable<org.apache.logging.log4j.Level>

public enum LoggingType extends Enum<LoggingType> implements Iterable<org.apache.logging.log4j.Level>
The possible logging types.
Implements Iterable to allow iterating over the allowed levels.
  • Enum Constant Details

    • CONSOLE

      public static final LoggingType CONSOLE
      The logging will be printed to the console.
    • FILE

      public static final LoggingType FILE
      The logging will be printed to a file.
  • Field Details

    • CONSOLE_LEVELS

      private static final org.apache.logging.log4j.Level[] CONSOLE_LEVELS
      Supported console logging levels.
    • FILE_LEVELS

      private static final org.apache.logging.log4j.Level[] FILE_LEVELS
      Supported file logging levels.
  • Constructor Details

    • LoggingType

      private LoggingType()
  • Method Details

    • values

      public static LoggingType[] 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 LoggingType 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
    • getAllowedLevels

      public org.apache.logging.log4j.Level @NotNull [] getAllowedLevels()
      Gets the allowed levels for this logging type.
      Returns:
      An array of allowed levels
      Throws:
      IllegalStateException - If the logging type is unknown
    • iterator

      @NotNull public @NotNull Iterator<org.apache.logging.log4j.Level> iterator()
      Specified by:
      iterator in interface Iterable<org.apache.logging.log4j.Level>
    • createIterator

      @NotNull private @NotNull Iterator<org.apache.logging.log4j.Level> createIterator(org.apache.logging.log4j.Level @NotNull [] levels)
      Creates an iterator for the given levels.
      Parameters:
      levels - The levels
      Returns:
      The created iterator
    • toString

      @NotNull public @NotNull String toString()
      Overrides:
      toString in class Enum<LoggingType>