Example usage for org.springframework.util Assert state

List of usage examples for org.springframework.util Assert state

Introduction

In this page you can find the example usage for org.springframework.util Assert state.

Prototype

public static void state(boolean expression, Supplier<String> messageSupplier) 

Source Link

Document

Assert a boolean expression, throwing an IllegalStateException if the expression evaluates to false .

Usage

From source file:example.app.caching.provider.support.AbstractJsr107CachingProviderTests.java

protected CacheManager getCacheManager() {
    Assert.state(cacheManager != null, "CacheManager was not properly configured and initialized");
    return this.cacheManager;
}

From source file:com.autentia.wuija.view.ApplicationBreadcrumb.java

public <T extends View> void setHome(View homeView) {
    Assert.state(viewsStack.isEmpty(), "Cannot call setHome() if viewStack is not empty.");
    viewsStack.addFirst(homeView);//from  www.ja  v a 2  s  .c  om
}

From source file:org.eclipse.swordfish.core.configuration.xml.XmlToPropertiesTransformerImpl.java

public Map<String, Map<String, String>> getPropertiesForPids() {
    Assert.state(properties != null, "Configuration is not loaded");
    Set<String> prefixes = getPidPrefixes(properties.keySet());
    Map<String, Map<String, String>> ret = new HashMap<String, Map<String, String>>();
    for (String prefix : prefixes) {
        Map<String, String> pidProps = new HashMap<String, String>();
        for (String key : getKeysForPid(properties.keySet(), prefix)) {
            pidProps.put(key.substring(prefix.length() + 1), properties.get(key));
        }/*from ww w.j  av a  2  s  . c  o m*/
        ret.put(prefix, pidProps);
    }
    return ret;
}

From source file:org.cloudfoundry.identity.uaa.scim.endpoints.UserIdInjector.java

@Override
public void afterPropertiesSet() throws Exception {
    Assert.state(scimUserProvisioning != null, "ScimUserProvisioning must be provided");
}

From source file:jails.http.client.AbstractClientHttpRequest.java

private void checkExecuted() {
    Assert.state(!this.executed, "ClientHttpRequest already executed");
}

From source file:net.sf.gazpachoquest.services.core.impl.QuestionOptionServiceImpl.java

@Override
@Transactional(readOnly = false)/*from  w  ww .j  a  v a 2 s. c o  m*/
public QuestionOption save(final QuestionOption entity) {
    Assert.state(!entity.isNew(), "QuestionOption must be already persisted. Try by adding to question first.");
    QuestionOption existing = repository.save(entity);
    existing.setLanguage(entity.getLanguage());
    existing.setLanguageSettings(entity.getLanguageSettings());
    return existing;
}

From source file:org.spring.data.gemfire.config.RegionPutAllBeanPostProcessor.java

protected String getTargetBeanName() {
    Assert.state(StringUtils.hasText(targetBeanName),
            "The target Spring context bean name was not properly specified!");
    return targetBeanName;
}

From source file:com.sshdemo.common.schedule.generate.quartz.EwcmsCronTriggerBean.java

public void setStartDelay(long startDelay) {
    Assert.state(startDelay >= 0L, "Start delay cannot be negative.");
    this.startDelay = startDelay;
}

From source file:org.spring.data.gemfire.config.LocatorLauncherFactoryBean.java

@Override
public LocatorLauncher getObject() throws Exception {
    Assert.state(locator != null, "The GemFire Locator was not properly initialized!");
    return locator;
}

From source file:com.github.dactiv.common.spring.SpringContextHolder.java

/**
 * ApplicationContext?.//from   ww w  . j a  va 2 s .co m
 */
private static void assertContextInjected() {
    Assert.state(applicationContext != null,
            "applicaitonContext, applicationContext.xmlSpringContextHolder.");
}