public boolean getBooleanFrom(JsonValue json) {

    if (json.isBoolean()) {
      return json.asBoolean();
    }

    if (json.isNumber()) {
      if (json.asInt() == 0) {
        return Boolean.FALSE;
      }
      if (json.asInt() == 1) {
        return Boolean.TRUE;
      }
    }

    if (json.isString()) {
      String value = json.asString();
      if (value.equalsIgnoreCase("false")) {
        return Boolean.FALSE;
      }
      if (value.equalsIgnoreCase("true")) {
        return Boolean.TRUE;
      }
    }

    throw new UnsupportedOperationException("Json is not a boolean: " + json);
  }
public boolean getBooleanFrom ( JsonValue json ) { if ( json . isBoolean ( ) ) { return json . asBoolean ( ) ; } if ( json . isNumber ( ) ) { if ( json . asInt ( ) == 0 ) { return Boolean . FALSE ; } if ( json . asInt ( ) == 1 ) { return Boolean . TRUE ; } } if ( json . isString ( ) ) { String value = json . asString ( ) ; if ( value . equalsIgnoreCase ( "false" ) ) { return Boolean . FALSE ; } if ( value . equalsIgnoreCase ( "true" ) ) { return Boolean . TRUE ; } } throw new UnsupportedOperationException ( "Json is not a boolean: " + json ) ; }
convert {@link JsonValue} into Boolean.

if the gven type is a boolean the json internal conversion is used. 0 or 1 are converted to False or True

The Strings false and true are converted to the corresponding types

@param json
@return