List of usage examples for java.lang Boolean parseBoolean
public static boolean parseBoolean(String s)
From source file:com.haulmont.cuba.gui.xml.layout.loaders.CurrencyFieldLoader.java
protected void loadShowCurrencyLabel(CurrencyField resultComponent, Element element) { String showCurrency = element.attributeValue("showCurrencyLabel"); if (StringUtils.isNotEmpty(showCurrency)) { resultComponent.setShowCurrencyLabel(Boolean.parseBoolean(showCurrency)); }/*from w w w .ja v a 2 s . com*/ }
From source file:biz.c24.io.spring.batch.config.TransformItemProcessorParser.java
@Override protected void doParse(Element element, BeanDefinitionBuilder builder) { // Mandatory//w ww .j av a 2 s.co m String transformId = element.getAttribute("transform-ref"); builder.addPropertyReference("transformer", transformId); // Optional String validate = element.getAttribute("validate"); if (StringUtils.hasText(validate)) { builder.addPropertyValue("validation", validate); } // Optional String failfast = element.getAttribute("failfast"); if (StringUtils.hasText(failfast)) { boolean val = Boolean.parseBoolean(failfast); builder.addPropertyValue("failfast", val); } // Optional String targetClass = element.getAttribute("target-class"); if (StringUtils.hasText(targetClass)) { builder.addPropertyValue("targetClass", targetClass); } }
From source file:gov.nih.nci.protexpress.util.ConfigurationHelper.java
/** * @return is ldap install?/*from w ww .j ava 2 s . co m*/ */ public static boolean isLdapInstallation() { return Boolean.parseBoolean(ConfigurationHelper.getLdapContextParameters().get("ldap.install")); }
From source file:com.github.carlomicieli.rest.representations.ScaleRepresentation.java
/** * Creates new <em>Scale</em> representation. * @param formValues the form values.// w ww .jav a2 s . co m * @param formValues */ public ScaleRepresentation(MultivaluedMap<String, String> formValues) { this(); long id = 0; try { id = Long.parseLong(formValues.getFirst("id")); } catch (NumberFormatException ex) { } int ratio = 0; try { ratio = Integer.parseInt(formValues.getFirst("ratio")); } catch (NumberFormatException ex) { throw new WebApplicationException(Status.BAD_REQUEST); } boolean isNarrow = Boolean.parseBoolean(formValues.getFirst("narrow")); setId(id); setRatio(ratio); setName(formValues.getFirst("name")); setNarrow(isNarrow); }
From source file:org.openscore.content.httpclient.build.ContextBuilder.java
public HttpClientContext build() { if (StringUtils.isEmpty(preemptiveAuth)) { preemptiveAuth = "true"; }/*from ww w .jav a2s. c o m*/ HttpClientContext context = HttpClientContext.create(); if (authTypes.size() == 1 && Boolean.parseBoolean(preemptiveAuth)) { AuthCache authCache = new BasicAuthCache(); authCache.put(new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme()), authSchemeLookup.lookup(authTypes.iterator().next()).create(context)); context.setCredentialsProvider(credentialsProvider); context.setAuthCache(authCache); } return context; }
From source file:bencoding.securely.Converters.java
public static Boolean StringToBoolean(String value) { Boolean ifNullValue = false;// w w w. j ava 2s. c o m if (value == null) { return ifNullValue; } return Boolean.parseBoolean(value); }
From source file:io.cloudslang.content.httpclient.build.ContextBuilder.java
public HttpClientContext build() { if (StringUtils.isEmpty(preemptiveAuth)) { preemptiveAuth = "true"; }/* w w w. j a va2 s .co m*/ HttpClientContext context = HttpClientContext.create(); if (authTypes.size() == 1 && Boolean.parseBoolean(preemptiveAuth) && !authTypes.contains(AuthTypes.ANONYMOUS)) { AuthCache authCache = new BasicAuthCache(); authCache.put(new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme()), authSchemeLookup.lookup(authTypes.iterator().next()).create(context)); context.setCredentialsProvider(credentialsProvider); context.setAuthCache(authCache); } return context; }
From source file:com.evolveum.polygon.connector.drupal.TestClient.java
@BeforeClass public static void setUp() throws Exception { String fileName = "test.properties"; final Properties properties = new Properties(); InputStream inputStream = TestClient.class.getClassLoader().getResourceAsStream(fileName); if (inputStream == null) { throw new IOException("Sorry, unable to find " + fileName); }/*w w w . j a va2s .c o m*/ properties.load(inputStream); conf = new DrupalConfiguration(); conf.setUsername(properties.getProperty("username")); conf.setPassword(new GuardedString(properties.getProperty("password").toCharArray())); conf.setServiceAddress(properties.getProperty("serviceAddress")); conf.setAuthMethod(properties.getProperty("authMethod")); conf.setTrustAllCertificates(Boolean.parseBoolean(properties.getProperty("trustAllCertificates"))); conf.setUserDeleteDisabled(Boolean.parseBoolean(properties.getProperty("userDeleteDisabled"))); conf.setPageSize(Integer.parseInt(properties.getProperty("pageSize"))); if (properties.containsKey("userFields")) { String[] userFields = properties.getProperty("userFields").split(";"); conf.setUserFields(userFields); } if (properties.containsKey("taxonomies")) { String[] taxonomies = properties.getProperty("taxonomies").split(";"); conf.setTaxonomies(taxonomies); } if (properties.containsKey("createTaxonomyWhenNameNotExists")) { String[] createTaxonomyWhenNameNotExists = properties.getProperty("createTaxonomyWhenNameNotExists") .split(";"); conf.setCreateTaxonomyWhenNameNotExists(createTaxonomyWhenNameNotExists); } if (properties.containsKey("createNodeWhenTitleNotExists")) { String[] createNodeWhenTitleNotExists = properties.getProperty("createNodeWhenTitleNotExists") .split(";"); conf.setCreateNodeWhenTitleNotExists(createNodeWhenTitleNotExists); } if (properties.containsKey("userFields")) { String[] userFields = properties.getProperty("userFields").split(";"); conf.setUserFields(userFields); } if (properties.containsKey("requiredFields")) { String[] requiredFields = properties.getProperty("requiredFields").split(";"); conf.setRequiredFields(requiredFields); } if (properties.containsKey("dontReadUserDetailsWhenFindAllUsers")) { conf.setDontReadUserDetailsWhenFindAllUsers( Boolean.parseBoolean(properties.getProperty("dontReadUserDetailsWhenFindAllUsers"))); } conn = new DrupalConnector(); conn.init(conf); }
From source file:com.haulmont.cuba.gui.xml.layout.loaders.PopupViewLoader.java
protected void loadCaptionAsHtml(PopupView component, Element element) { String captionAsHtml = element.attributeValue("captionAsHtml"); if (StringUtils.isNotEmpty(captionAsHtml)) { component.setCaptionAsHtml(Boolean.parseBoolean(captionAsHtml)); }/* w w w .ja v a 2s . c om*/ }
From source file:com.haulmont.cuba.gui.xml.layout.loaders.TreeLoader.java
@Override public void loadComponent() { assignXmlDescriptor(resultComponent, element); assignFrame(resultComponent);//from w ww . j av a2s. c om loadVisible(resultComponent, element); loadEnable(resultComponent, element); loadEditable(resultComponent, element); loadHeight(resultComponent, element); loadWidth(resultComponent, element); loadTabIndex(resultComponent, element); loadStyleName(resultComponent, element); loadActions(resultComponent, element); loadButtonsPanel(resultComponent); String multiselect = element.attributeValue("multiselect"); if (StringUtils.isNotEmpty(multiselect)) { resultComponent.setMultiSelect(Boolean.parseBoolean(multiselect)); } loadTreeChildren(); loadIcon(resultComponent, element); loadCaption(resultComponent, element); loadDescription(resultComponent, element); }