added a getBoolean() method

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1724169 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2016-01-12 06:34:34 +00:00
parent c5883d54b9
commit 0a55d57763
1 changed files with 8 additions and 0 deletions

View File

@ -19,6 +19,8 @@ package org.apache.solr.util;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Collections;
@ -26,6 +28,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.io.input.CharSequenceReader;
import org.apache.lucene.util.IOUtils;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.util.ContentStream;
@ -59,6 +62,11 @@ public class CommandOperation {
Object o = getMapVal(key);
return o == null ? def : String.valueOf(o);
}
public boolean getBoolean(String key, boolean def) {
String v = getStr(key,null);
return v == null? def:Boolean.parseBoolean(v);
}
public void setCommandData(Object o){
commandData = o;
}