/** * Returns the Boolean value of the field param, * or the value for param, or null if neither is set. * Use this method only when you want to be explicit * about absence of a value (<code>null</code>) vs the default value <code>false</code>. * @see #getFieldBool(String, String, boolean) * @see #getPrimitiveFieldBool(String, String) **/ public Boolean getFieldBool(String field, String param) { String val = getFieldParam(field, param); return val==null ? null : StrUtils.parseBool(val); }
/** Returns the boolean value of the field param, or the value for param, or def if neither is set. */ public boolean getFieldBool(String field, String param, boolean def) { String val = getFieldParam(field, param); return val==null ? def : StrUtils.parseBool(val); }
public DebugInfo(Map<String,Object> requestParams) { verbose = StrUtils.parseBool((String) requestParams.get("verbose"), false); debugVerboseOutput = new NamedList<>(); } }
/** Returns the Boolean value of the param, or null if not set */ public Boolean getBool(String param) { String val = get(param); return val==null ? null : StrUtils.parseBool(val); }
/** Returns the boolean value of the param, or def if not set */ public boolean getBool(String param, boolean def) { String val = get(param); return val==null ? def : StrUtils.parseBool(val); }
/** Returns the Boolean value of the field param, or the value for param, or null if neither is set. */ public Boolean getFieldBool(String field, String param) { String val = getFieldParam(field, param); return val==null ? null : StrUtils.parseBool(val); }
/** * Returns the Boolean value of the param, or null if not set. * Use this method only when you want to be explicit * about absence of a value (<code>null</code>) vs the default value <code>false</code>. * @see #getBool(String, boolean) * @see #getPrimitiveBool(String) * **/ public Boolean getBool(String param) { String val = get(param); return val==null ? null : StrUtils.parseBool(val); }
/** Returns the boolean value of the param, or def if not set */ public boolean getBool(String param, boolean def) { String val = get(param); return val==null ? def : StrUtils.parseBool(val); }
/** * Returns the boolean value of the field param, * or the value for param, or def if neither is set. * * */ public boolean getFieldBool(String field, String param, boolean def) { String val = getFieldParam(field, param); return val==null ? def : StrUtils.parseBool(val); }
/** * Parse the {@value #SHARDS_TOLERANT} param from <code>params</code> as a boolean; * accepts {@value #REQUIRE_ZK_CONNECTED} as a valid value indicating <code>false</code>. * * By default, returns <code>false</code> when {@value #SHARDS_TOLERANT} is not set * in <code>params</code>. */ static boolean getShardsTolerantAsBool(SolrParams params) { String shardsTolerantValue = params.get(SHARDS_TOLERANT); if (null == shardsTolerantValue || shardsTolerantValue.equals(REQUIRE_ZK_CONNECTED)) { return false; } else { return StrUtils.parseBool(shardsTolerantValue); // throw an exception if non-boolean } } }
command = null; boolean debugMode = StrUtils.parseBool((String) requestParams.get("debug"), false); if (debugMode) { debug = true; clean = StrUtils.parseBool( (String) requestParams.get("clean"), true); } else if (DataImporter.DELTA_IMPORT_CMD.equals(command) || DataImporter.IMPORT_CMD.equals(command)) { clean = false; clean = debug ? false : true; optimize = StrUtils.parseBool((String) requestParams.get("optimize"), false); if(optimize) { commit = true; } else { commit = StrUtils.parseBool( (String) requestParams.get("commit"), (debug ? false : true)); start = 0; syncMode = StrUtils.parseBool((String) requestParams.get("synchronous"), false);
@Override @SuppressWarnings("unchecked") public void inform(SolrCore core) { try { String name = getPluginInfo().name; if (name.startsWith("/")) { myName = name.substring(1); } // some users may have '/' in the handler name. replace with '_' myName = myName.replaceAll("/", "_"); debugEnabled = StrUtils.parseBool((String)initArgs.get(ENABLE_DEBUG), true); importer = new DataImporter(core, myName); } catch (Exception e) { log.error( DataImporter.MSG.LOAD_EXP, e); throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, DataImporter.MSG.LOAD_EXP, e); } }