Exemplo n.º 1
0
 /**
  * Gets the ELogLevel identified by the given name.
  *
  * @param name The name of the ELogLevel to get.
  * @return Return the ELogLevel identified by the given name, or null if none exists.
  */
 public static ELogLevel getByName(String name) {
   if (name == null) {
     throw new IllegalArgumentException("name cannot be null!");
   } else {
     for (ELogLevel level : values()) {
       if (name.equals(level.getLevelName())) {
         return level;
       }
     }
     return null;
   }
 }
Exemplo n.º 2
0
 /**
  * Returns true if this ELogLevel is allowed with the specified priority.
  *
  * @param priority The priority to compare to.
  * @return Returns true if this ELogLevel is allowed with the specified priority.
  */
 public boolean isAllowed(ELogLevel priority) {
   return this.priority >= priority.getPriority();
 }