package org.apache.logging.log4j.spi;

import java.util.EnumSet;
import java.util.Iterator;

public enum StandardLevel {
   OFF(0),
   FATAL(100),
   ERROR(200),
   WARN(300),
   INFO(400),
   DEBUG(500),
   TRACE(600),
   ALL(Integer.MAX_VALUE);

   private final int intLevel;
   private static final EnumSet<StandardLevel> levelSet = EnumSet.allOf(StandardLevel.class);

   private StandardLevel(int val) {
      this.intLevel = val;
   }

   public int intLevel() {
      return this.intLevel;
   }

   public static StandardLevel getStandardLevel(int intLevel) {
      StandardLevel level = OFF;

      StandardLevel lvl;
      for(Iterator i$ = levelSet.iterator(); i$.hasNext(); level = lvl) {
         lvl = (StandardLevel)i$.next();
         if (lvl.intLevel() > intLevel) {
            break;
         }
      }

      return level;
   }
}
