Java slf4j Logger getIntValue(String strVal, int defVal)

Here you can find the source of getIntValue(String strVal, int defVal)

Description

get Int Value

License

Apache License

Declaration

public static int getIntValue(String strVal, int defVal) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Main {
    private static Logger log = LoggerFactory.getLogger("PersistenceUtil");

    public static int getIntValue(String strVal, int defVal) {
        try {//from ww w.  j a  v a  2  s .  c om
            return Integer.parseInt(strVal);
        } catch (Exception exp) {
            log.error("Invalid int value : " + strVal);
        }
        return defVal;
    }
}

Related

  1. format(String format, Object... args)
  2. format(String messagePattern, Object... args)
  3. get(Class clazz)
  4. getClassLogger()
  5. getErrorMsg(String format, Object[] argArray)
  6. getLog(Class clazz)
  7. getLogger()
  8. getLogger()
  9. getLogger()