List of usage examples for java.lang Boolean valueOf
public static Boolean valueOf(String s)
From source file:org.apache.maven.wagon.providers.http.HttpMethodConfiguration.java
public HttpMethodConfiguration setUseDefaultHeaders(boolean useDefaultHeaders) { this.useDefaultHeaders = Boolean.valueOf(useDefaultHeaders); return this; }
From source file:com.aurel.track.fieldType.fieldChange.converter.BooleanSetterConverter.java
/** * Convert the string to object value after load * @param value/*from w w w . j a v a 2 s.c om*/ * @param setter * @return */ @Override public Object getActualValueFromStoredString(String value, Integer setter) { if (value == null || value.trim().length() == 0) { return null; } else { try { return Boolean.valueOf(value); } catch (Exception e) { LOGGER.warn("Converting the " + value + " to Boolean failed with " + e.getMessage()); LOGGER.debug(ExceptionUtils.getStackTrace(e)); return Boolean.FALSE; } } }
From source file:com.redhat.rhn.frontend.struts.RhnUnpagedListAction.java
/** * Sets up the ListControl filter data// w w w.j a v a 2s . c o m * @param lc ListControl to use * @param request ServletRequest * @param viewer user requesting the page */ public void filterList(ListControl lc, ServletRequest request, User viewer) { /* * Make sure we have a user. If not, something bad happened and we should * just bail out with an exception. Since this is probably the result of * a bad uid param, throw a BadParameterException. */ if (viewer == null) { throw new BadParameterException("Null viewer"); } String filterData = request.getParameter(RequestContext.FILTER_STRING); request.setAttribute("isFiltered", Boolean.valueOf(!StringUtils.isEmpty(filterData))); if (!StringUtils.isBlank(filterData)) { HttpServletRequest req = (HttpServletRequest) request; createSuccessMessage(req, "filter.clearfilter", req.getRequestURI()); } lc.setFilterData(filterData); }
From source file:gov.nih.nci.cabig.caaers.web.search.SearchUserController.java
@Override protected Object formBackingObject(HttpServletRequest request) throws Exception { SearchUserCommand command = new SearchUserCommand(); String popupRequest = request.getParameter("popupRequest"); if (StringUtils.isNotEmpty(popupRequest)) { command.setPopupRequest(Boolean.valueOf(popupRequest)); }/*from w ww . ja v a 2 s . c o m*/ String popupRequestType = request.getParameter("popupRequestType"); if (StringUtils.isNotEmpty(popupRequestType)) { command.setPopupRequestType(popupRequestType); } return command; }
From source file:de.hybris.platform.acceleratorstorefrontcommons.util.AddressDataUtil.java
public void convert(final AddressData source, final AddressForm target) { convertBasic(source, target);/*from w w w .j a v a 2 s .com*/ target.setSaveInAddressBook(Boolean.valueOf(source.isVisibleInAddressBook())); target.setShippingAddress(Boolean.valueOf(source.isShippingAddress())); target.setBillingAddress(Boolean.valueOf(source.isBillingAddress())); target.setPhone(source.getPhone()); if (source.getRegion() != null && !StringUtils.isEmpty(source.getRegion().getIsocode())) { target.setRegionIso(source.getRegion().getIsocode()); } }
From source file:eu.optimis.tf.sp.service.SPCommon.java
public SPCommon() { production = Boolean.valueOf(PropertiesUtils.getProperty("TRUST", "production")); }
From source file:com.ea.core.cache.handle.AbstractCacheHandle.java
public AbstractCacheHandle(String cacheLevel) { this.level = cacheLevel; this.activate = Boolean.valueOf(CacheDefinition.getPropertyValue(cacheLevel + "activate")); if (activate) { ICachePool cachePool = null;//from ww w . j a va 2 s . c o m String cacheType = CacheDefinition.getPropertyValue(cacheLevel + "type"); if (CacheConstants.CACHE_TYPE.MEMCACHED.getCode().equals(cacheType)) { cachePool = new MemcachedPool(); } else if (CacheConstants.CACHE_TYPE.REDIS.getCode().equals(cacheType)) { String servers = CacheDefinition.getPropertyValue(cacheLevel + "servers"); if (servers.split(" ").length > 1) { cachePool = new RedisShardedPool(); } else { cachePool = new RedisGeneralPool(); } } else { throw new RuntimeException("???MEMCACHEDREDIS"); } cachePool.addRedisServer(CacheDefinition.getPropertyValue(cacheLevel + "servers")); cachePool.setMaxTotal(Integer.valueOf(CacheDefinition.getPropertyValue(cacheLevel + "maxTotal"))); cachePool.setMaxIdle(Integer.valueOf(CacheDefinition.getPropertyValue(cacheLevel + "maxIdle"))); cachePool.setMaxConnectMillis( Integer.valueOf(CacheDefinition.getPropertyValue(cacheLevel + "maxConnectMillis"))); cachePool.setMaxWaitMillis( Integer.valueOf(CacheDefinition.getPropertyValue(cacheLevel + "maxWaitMillis"))); cachePool.setEnableHealSession( Boolean.valueOf(CacheDefinition.getPropertyValue(cacheLevel + "enableHealSession"))); cachePool.setHealSessionInterval( Integer.valueOf(CacheDefinition.getPropertyValue(cacheLevel + "healSessionInterval"))); cachePool.setFailureMode(Boolean.valueOf(CacheDefinition.getPropertyValue(cacheLevel + "failureMode"))); cachePool.setTestOnBorrow( Boolean.valueOf(CacheDefinition.getPropertyValue(cacheLevel + "testOnBorrow"))); cachePool.setTestOnReturn( Boolean.valueOf(CacheDefinition.getPropertyValue(cacheLevel + "testOnReturn"))); cachePool.setLifo(Boolean.valueOf(CacheDefinition.getPropertyValue(cacheLevel + "lifo"))); this.client = new CacheClient(cachePool); } }
From source file:net.sourceforge.fenixedu.dataTransferObject.oldInquiries.InquiriesQuestion.java
public Boolean getValueAsBoolean() { return getValue() != null && (Boolean.valueOf(getValue()) || getValue().equalsIgnoreCase("on")); }
From source file:com.urbancode.ud.client.UDRestClient.java
/** * Create an HTTP client configuring trustAllCerts using agent environment variables * * @param user The username to associate with the http client connection. * @param password The password of the username used to associate with the http client connection. * @see #createHttpClient(String,String,boolean) * * @return DefaultHttpClient/* ww w.jav a2 s.c o m*/ */ static public DefaultHttpClient createHttpClient(String user, String password) { String verifyServerIdentityString = System.getenv().get("UC_TLS_VERIFY_CERTS"); Boolean verifiedCerts = Boolean.valueOf(verifyServerIdentityString); return createHttpClient(user, password, !verifiedCerts); }