Example usage for org.springframework.util Assert hasText

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

Introduction

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

Prototype

public static void hasText(@Nullable String text, Supplier<String> messageSupplier) 

Source Link

Document

Assert that the given String contains valid text content; that is, it must not be null and must contain at least one non-whitespace character.

Usage

From source file:org.codehaus.mojo.hibernate3.processor.implementations.AuditingProcessor.java

@Override
public void setComponentProperties(Map<String, String> componentProperties) {
    this.auditListenerClass = componentProperties.get(AUDIT_ENTITY_LISTENER_CLASS);
    Assert.hasText(this.auditListenerClass, "the audit class component can't be null!");
}

From source file:com.azaptree.services.security.domain.impl.SessionAttributeImpl.java

public SessionAttributeImpl(final UUID sessionId, final String name, final String json) {
    Assert.notNull(sessionId, "sessionId is required");
    Assert.hasText(name, "name is required");
    Assert.hasText(json, "json is required");
    this.sessionId = sessionId;
    this.name = name;
    setJson(json);/*ww  w. java 2 s.  c o m*/
}

From source file:org.openscada.spring.server.NetExporter.java

@Override
public void afterPropertiesSet() throws Exception {
    Assert.notNull(this.hive, "'hive' must be set");
    Assert.hasText(this.connectionString, "'connectionString' must be set");

    this.exporter = new Exporter(this.hive, ConnectionInformation.fromURI(this.connectionString));
    this.exporter.start();
}

From source file:devbury.dewey.hipchat.HipChatSettings.java

@PostConstruct
public void checkProperties() {
    Assert.hasText(email, "hipchat.email is not set!");
    Assert.hasText(password, "hipchat.password is not set!");
    Assert.hasText(apiToken, "hipchat.apiToken is not set!");
    if (!groupsToJoin.isEmpty()) {
        logger.info("{}", groupsToJoin.stream().collect(Collectors.joining(", ", "Only joining groups: ", "")));
    }/*from   w  ww.  jav  a 2  s .com*/
}

From source file:io.galeb.core.entity.BalancePolicy.java

public BalancePolicy(String name, BalancePolicyType balancePolicyType) {
    Assert.hasText(name,
            "[Assertion failed] - this String argument must have text; it must not be null, empty, or blank");
    Assert.notNull(balancePolicyType, "[Assertion failed] - this argument is required; it must not be null");
    setName(name);/*w  ww . j av a  2s .  c o m*/
    this.balancePolicyType = balancePolicyType;
}

From source file:org.cleverbus.core.common.contextcall.ContextCallRegistryMemoryImpl.java

@Override
public void addParams(String callId, ContextCallParams params) {
    Assert.hasText(callId, "the callId must not be empty");
    Assert.notNull(params, "the params must not be null");

    if (paramsRegistry.get(callId) != null) {
        throw new IllegalStateException("there are already call params with call ID = " + callId);
    }/*from  w w w.  jav  a  2s .c o m*/

    paramsRegistry.put(callId, params);

    Log.debug("Call params with callId=" + callId + " added to registry: " + params);

    removeOldParams();
}

From source file:fr.mby.utils.spring.beans.factory.ProxywiredField.java

protected ProxywiredField(final DependencyDescriptor descriptor, final String wiredClassName) {
    super();//w w  w .j a  v a2  s  .  co m

    Assert.notNull(descriptor, "No DependencyDescriptor provided !");
    final Field field = descriptor.getField();
    Assert.notNull(field, "DependencyDescriptor provided don't describe a Field !");
    final String fieldName = field.getName();

    Assert.hasText(wiredClassName, "Wired class name cannot be found !");

    this.buildNodePath(wiredClassName, fieldName);
}

From source file:biz.c24.io.spring.integration.router.C24XPathRouter.java

/**
 * Create a router that uses an XPath expression.
 * /*from w w w . ja v a2  s  . c o m*/
 * @param expression
 *            the XPath expression as a String
 */
public C24XPathRouter(String expression) {
    Assert.hasText(expression, "expression must not be empty");
    this.statement = new XPathStatement(expression);
}

From source file:com.frank.search.solr.core.query.StatsOptions.java

/**
 * Adds a field via its name to the statistics to be requested.
 * /*from   w  w  w . j a va  2s  .  c o m*/
 * @param fieldName
 * @return
 */
public FieldStatsOptions addField(String fieldName) {

    Assert.hasText(fieldName, "Fieldname for statistics must not be blank.");

    return addField(new SimpleField(fieldName));
}

From source file:org.cleverbus.core.common.directcall.DirectCallParams.java

public DirectCallParams(Object body, String uri, String senderRef, @Nullable String soapAction,
        @Nullable String header) {
    Assert.notNull(body, "the body must not be null");
    Assert.hasText(uri, "the uri must not be empty");
    Assert.hasText(senderRef, "the senderRef must not be empty");

    this.body = body;
    this.uri = uri;
    this.senderRef = senderRef;
    this.soapAction = soapAction;
    this.header = header;
    this.creationTimestamp = DateTime.now();
}