List of usage examples for org.springframework.util StringUtils isEmpty
public static boolean isEmpty(@Nullable Object str)
From source file:com.sastix.cms.server.utils.FileService.java
public String saveResource(String resourceExternalURI, String relativePath) { String path = null;/*from w w w. j av a 2 s . c o m*/ if (!StringUtils.isEmpty(resourceExternalURI)) { path = downloadResource(resourceExternalURI, relativePath); } return path; }
From source file:org.cleverbus.admin.web.console.ConsoleController.java
@RequestMapping("/console") public String showConsole(@ModelAttribute("model") ModelMap model) { // this variable is set only if monitoring is switched on final String state = System.getProperty(JAVAMELODY_DISABLED); final Boolean monitoring = StringUtils.isEmpty(state) || Boolean.valueOf(state).equals(Boolean.TRUE); model.addAttribute("javamelody", monitoring); return VIEW_NAME; }
From source file:de.codecentric.boot.admin.discovery.EurekaServiceInstanceConverter.java
@Override protected URI getHealthUrl(ServiceInstance instance) { Assert.isInstanceOf(EurekaServiceInstance.class, instance, "serviceInstance must be of type EurekaServiceInstance"); InstanceInfo instanceInfo = ((EurekaServiceInstance) instance).getInstanceInfo(); String healthUrl = instanceInfo.getSecureHealthCheckUrl(); if (StringUtils.isEmpty(healthUrl)) { healthUrl = instanceInfo.getHealthCheckUrl(); }//w ww .j a v a 2 s .com return URI.create(healthUrl); }
From source file:org.ihtsdo.otf.refset.service.upload.SimpleRefsetProcessor.java
@Override public Map<String, String> process(List<Rf2Record> rf2rLst, String refsetId, String user) throws RefsetServiceException, EntityNotFoundException { if (StringUtils.isEmpty(refsetId) || CollectionUtils.isEmpty(rf2rLst)) { throw new RefsetServiceException( "Not enough data to process. please check your request and imported file"); }//from w ww . j a va 2 s .c o m try { return gao.addMembers(rf2rLst, refsetId, user); } catch (RefsetGraphAccessException e) { throw new RefsetServiceException(e); } }
From source file:com.test.springmvc.springmvcproject.dv.beans.RegisterBean.java
@AssertTrue() private boolean isValid() { if (null != this.password && !StringUtils.isEmpty(this.password)) { return this.password.equals(this.passwordConfirmation); } else {/*from ww w . j a v a2 s.c o m*/ return true; } }
From source file:org.zht.framework.cache.BaseCacheAspect.java
@SuppressWarnings("unchecked") public <T> T get(Object key) { log.debug("cacheName:{}, get key:{}", cacheName, key); if (StringUtils.isEmpty(key)) { return null; }//from w w w . ja v a 2 s. c om Cache.ValueWrapper value = cache.get(key); if (value == null) { return null; } return (T) value.get(); }
From source file:com.cxplonka.feature.ui.vaadin.DataTableView.java
private void filterCustomers(String lastName) { if (StringUtils.isEmpty(lastName)) { grid.setItems(repo.findAll());/*from www. j a va2s . com*/ } else { grid.setItems(repo.findByLastNameStartsWithIgnoreCase(lastName)); } }
From source file:org.carewebframework.vista.api.JsonDomainFactory.java
/** * Fetch an instance of the domain class from the data store. *//* www . j a va 2s . c om*/ @SuppressWarnings("unchecked") @Override public <T extends Object> T fetchObject(Class<T> clazz, String id) { if (StringUtils.isEmpty(id)) { return null; } String json = VistAUtil.getBrokerSession().callRPC("RGSER FETCH", PREFIX + getAlias(clazz), id); return (T) JSONUtil.deserialize(json); }
From source file:com.zxy.commons.apidocs.conf.SwaggerConfiguareCondition.java
@Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { String enabled = context.getEnvironment().getProperty("apidocs.enabled"); if (!StringUtils.isEmpty(enabled) && "false".equalsIgnoreCase(enabled)) { return false; }/*from w w w . j a va 2 s . c o m*/ // String xmlEnabled = context.getEnvironment().getProperty("apidocs.use.xml.enabled"); // if(!StringUtils.isEmpty(xmlEnabled) && "true".equalsIgnoreCase(xmlEnabled)) { // return false; // } try { // ?jar?, ?, ?? context.getClassLoader().loadClass(Docket.class.getName()); return true; } catch (Exception ex) { return false; } }
From source file:se.inera.intyg.intygstjanst.web.integration.validator.RevokeRequestValidator.java
public void validateAndCorrect() throws CertificateValidationException { // First, validate properties at Revoke request level if (StringUtils.isEmpty(revokeRequest.getVardReferensId())) { validationErrors.add("No vardReferens found!"); }// w w w. j av a 2 s . c o m if (revokeRequest.getAvsantTidpunkt() == null) { validationErrors.add("No avsantTidpunkt found!"); } // use commmon validators for common elements new LakarutlatandeEnkelTypeValidator(revokeRequest.getLakarutlatande(), validationErrors) .validateAndCorrect(); new VardAdresseringsTypeValidator(revokeRequest.getAdressVard(), validationErrors).validateAndCorrect(); if (!validationErrors.isEmpty()) { throw new CertificateValidationException(validationErrors); } }