List of usage examples for java.lang Boolean parseBoolean
public static boolean parseBoolean(String s)
From source file:eu.itesla_project.iidm.ddb.psse_imp_exp.tools.tools.DdbLoaderTool.java
@Override public void run(CommandLine line) throws Exception { String dyrPathS = line.getOptionValue(DdbLoaderCommand.PSSE_DYRFILEPATH); String mappingPathS = line.getOptionValue(DdbLoaderCommand.PSSE_MAPPINGFILEPATH); String jbossHost = line.getOptionValue(DdbLoaderCommand.HOST); String jbossPort = line.getOptionValue(DdbLoaderCommand.PORT); String jbossUser = line.getOptionValue(DdbLoaderCommand.USER); String jbossPassword = line.getOptionValue(DdbLoaderCommand.PASSWORD); String psseVersion = line.getOptionValue(DdbLoaderCommand.PSSE_VERSION); String optionRemoveData = line.getOptionValue(DdbLoaderCommand.OPTION_REMOVE); DdbConfig ddbConfig = new DdbConfig(jbossHost, jbossPort, jbossUser, jbossPassword); Path dyrPath = Paths.get(dyrPathS); Path mappingPath = Paths.get(mappingPathS); DdbDyrLoader dyrLoader = new DdbDyrLoader(); boolean removeDataAfterHavingLoadedIt = Boolean.parseBoolean(optionRemoveData); dyrLoader.load(dyrPath, mappingPath, psseVersion, ddbConfig, removeDataAfterHavingLoadedIt); }
From source file:com.haulmont.cuba.gui.xml.layout.loaders.ProgressBarLoader.java
protected void loadIndeterminate(ProgressBar component, Element element) { String indeterminate = element.attributeValue("indeterminate"); if (StringUtils.isNotEmpty(indeterminate)) { component.setIndeterminate(Boolean.parseBoolean(indeterminate)); }//from w w w .j a va 2 s .co m }
From source file:de.hska.ld.core.controller.InfoController.java
@Autowired public void init(Environment env) { try {/*from w w w . j a v a 2 s . c om*/ Properties infoProp = PropertiesLoaderUtils.loadAllProperties("info.properties"); String sandbox = Boolean.parseBoolean(env.getProperty("module.sandbox.enabled")) ? " Sandbox" : ""; info = new Info(infoProp.getProperty("info.title") + sandbox, infoProp.getProperty("info.version"), infoProp.getProperty("info.organization")); } catch (IOException exception) { // } }
From source file:it.govpay.web.rs.dars.anagrafica.iban.input.IdNegozio.java
@Override protected String getDefaultValue(List<RawParamValue> values, Object... objects) { String attivatoObepValue = Utils.getValue(values, this.attivatoObepId); if (StringUtils.isNotEmpty(attivatoObepValue) && Boolean.parseBoolean(attivatoObepValue)) { return ""; }// w w w .j a va 2 s . c o m return null; }
From source file:com.kbotpro.cache.xml.XMLParser.java
public Object getValue(Element element) { final String type = element.getAttributeValue("type"); if (type == null) { return null; }// w ww . ja v a 2 s . c o m if (element.getText() == null) { return null; } if (type.equals("int")) { return Integer.parseInt(element.getText()); } if (type.equals("long")) { return Long.parseLong(element.getText()); } if (type.equals("double")) { return Double.parseDouble(element.getText()); } if (type.equals("float")) { return Float.parseFloat(element.getText()); } if (type.equals("boolean")) { return Boolean.parseBoolean(element.getText()); } if (type.equals("base64")) { return Base64.decodeBase64(element.getText()); } if (type.equals("string")) { return element.getText(); } if (type.equals("null")) { return null; } return null; }
From source file:com.haulmont.cuba.gui.xml.layout.loaders.TextAreaLoader.java
@Override public void loadComponent() { super.loadComponent(); loadMaxLength(resultComponent, element); loadTrimming(resultComponent, element); loadInputPrompt(resultComponent, element); loadCaseConversion(resultComponent, element); loadTextChangeEventProperties(resultComponent, element); String cols = element.attributeValue("cols"); if (StringUtils.isNotEmpty(cols)) { resultComponent.setColumns(Integer.parseInt(cols)); }/*from ww w .java 2 s .co m*/ String rows = element.attributeValue("rows"); if (StringUtils.isNotEmpty(rows)) { resultComponent.setRows(Integer.parseInt(rows)); } String wordwrap = element.attributeValue("wordwrap"); if (StringUtils.isNotEmpty(wordwrap)) { resultComponent.setWordwrap(Boolean.parseBoolean(wordwrap)); } String datatypeAttribute = element.attributeValue("datatype"); if (StringUtils.isNotEmpty(datatypeAttribute)) { Datatype datatype = Datatypes.get(datatypeAttribute); resultComponent.setDatatype(datatype); } }
From source file:AIR.Common.Configuration.AppSettingsHelper.java
private static boolean getBoolean(String key, Boolean defaultValue) { String rawValue = get(key);/*from w w w . j av a 2 s . com*/ if (!StringUtils.isEmpty(rawValue)) { boolean value = Boolean.parseBoolean(rawValue); return value; } if (defaultValue != null) return defaultValue.booleanValue(); else return false; }
From source file:com.haulmont.cuba.gui.config.WindowInfo.java
public boolean getMultipleOpen() { return Boolean.parseBoolean(descriptor.attributeValue("multipleOpen")); }
From source file:de.felixschulze.teamcity.xcode.XcodeBuildProcess.java
@NotNull public BuildFinishedStatus call() throws Exception { final BuildProgressLogger logger = build.getBuildLogger(); logger.targetStarted("Xcode build"); final String projectFile = getParameter(XcodeConstants.PARAM_PROJECT, true); final String target = getParameter(XcodeConstants.PARAM_TARGETNAME, false); final String configuration = getParameter(XcodeConstants.PARAM_CONFIGURATION, false); final String sdk = getParameter(XcodeConstants.PARAM_SDK, false); final Boolean clean = Boolean.parseBoolean(getParameter(XcodeConstants.PARAM_CLEAN, false)); final Boolean ignoreUnitTests = Boolean .parseBoolean(getParameter(XcodeConstants.PARAM_IGNOREUNITESTS, false)); if (clean) {// w w w .ja v a 2 s . com cleanXcodeProject(projectFile, target, configuration); } final long startTime = System.currentTimeMillis(); if (buildXcodeProject(projectFile, target, configuration, sdk, ignoreUnitTests)) { final long endTime = System.currentTimeMillis(); logger.message("Build finished (took " + ((endTime - startTime) / 1000) + " seconds)"); logger.targetFinished("Xcode build"); return BuildFinishedStatus.FINISHED_SUCCESS; } else { logger.error("Error during Xcode build."); return BuildFinishedStatus.FINISHED_FAILED; } }
From source file:com.nextdoor.bender.deserializer.regex.RegexDeserializer.java
@Override public DeserializedEvent deserialize(String raw) { Matcher m = this.pattern.matcher(raw); if (!m.matches()) { throw new DeserializationException("raw event does not match string"); }//from w w w . ja v a 2 s.c o m int groups = m.groupCount(); JsonObject obj = new JsonObject(); for (int i = 0; i < groups && i < fields.size(); i++) { String str = m.group(i + 1); ReFieldConfig field = this.fields.get(i); switch (field.getType()) { case BOOLEAN: obj.addProperty(field.getName(), Boolean.parseBoolean(str)); break; case NUMBER: obj.addProperty(field.getName(), NumberUtils.createNumber(str)); break; case STRING: obj.addProperty(field.getName(), str); break; default: obj.addProperty(field.getName(), str); break; } } return new GenericJsonEvent(obj); }