Java Boolean From toBoolean(final String val)

Here you can find the source of toBoolean(final String val)

Description

to Boolean

License

Open Source License

Declaration

private static Object toBoolean(final String val) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static Object toBoolean(final String val) {
        if (val.equalsIgnoreCase("on")) {
            return Boolean.TRUE;
        } else if (val.equalsIgnoreCase("off")) {
            return Boolean.FALSE;
        }//from  www.  ja  v  a  2  s  .co m
        return Boolean.parseBoolean(val);
    }
}

Related

  1. toBoolean(final String s)
  2. toBoolean(final String s)
  3. toBoolean(final String source)
  4. toBoolean(final String string)
  5. toBoolean(final String strTransparent)
  6. toBoolean(final String value)
  7. toBoolean(final String value)
  8. toBoolean(final String value)
  9. toBoolean(final String value, final boolean def)