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

@Deprecated
public static void hasText(@Nullable String text) 

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.cloudfoundry.identity.uaa.api.client.impl.UaaClientOperationsImpl.java

public BaseClientDetails delete(String clientId) {
    Assert.hasText(clientId);
    return helper.delete("/oauth/clients/{id}", CLIENT_REF, clientId);
}

From source file:gemfire.practice.domain.Product.java

/**
 * Sets the attribute with the given name to the given value.
 * /*from ww  w .j  av  a2 s. co  m*/
 * @param name must not be {@literal null} or empty.
 * @param value
 */
public void setAttribute(String name, String value) {

    Assert.hasText(name);

    if (value == null) {
        attributes.remove(value);
    } else {
        attributes.put(name, value);
    }
}

From source file:org.cloudfoundry.identity.uaa.api.user.impl.UaaUserOperationsImpl.java

public void deleteUser(String userId) {
    Assert.hasText(userId);
    helper.delete("/Users/{id}", STRING_REF, userId);
}

From source file:com.frank.search.solr.server.support.EmbeddedSolrServerFactory.java

/**
 * @param solrHome/*  w  w w.  java2 s  .c o m*/
 *            Any Path expression valid for use with
 *            {@link org.springframework.util.ResourceUtils} that points to
 *            the {@code solr.solr.home} directory
 * @throws javax.xml.parsers.ParserConfigurationException
 * @throws java.io.IOException
 * @throws org.xml.sax.SAXException
 */
public EmbeddedSolrServerFactory(String solrHome)
        throws ParserConfigurationException, IOException, SAXException {
    Assert.hasText(solrHome);
    this.solrHome = solrHome;
}

From source file:org.red5.server.script.jython.JythonScriptFactory.java

@SuppressWarnings({ "rawtypes" })
public JythonScriptFactory(String scriptSourceLocator, Class[] scriptInterfaces, Object[] arguments) {
    Assert.hasText(scriptSourceLocator);
    Assert.notEmpty(scriptInterfaces);//from   w  ww.j  a  va  2  s .  co  m
    this.scriptSourceLocator = scriptSourceLocator;
    this.scriptInterfaces = scriptInterfaces;
    if (arguments == null || arguments.length == 0) {
        this.arguments = null;
    } else {
        this.arguments = arguments;
    }
}

From source file:team.curise.dao.BaseDao.java

/**
 * orderby??/*from www  .ja v  a2s .  c o m*/
 * @param hql
 * @return
 */
public static String removeOrders(String hql) {
    Assert.hasText(hql);
    Pattern p = Pattern.compile("order\\s*by[\\w|\\W|\\s|\\S]*", Pattern.CASE_INSENSITIVE);
    Matcher m = p.matcher(hql);
    StringBuffer sb = new StringBuffer();
    while (m.find()) {
        m.appendReplacement(sb, "");
    }
    m.appendTail(sb);
    return sb.toString();
}

From source file:org.cloudfoundry.identity.uaa.api.group.impl.UaaGroupOperationsImpl.java

public ScimGroup createGroup(ScimGroup group) {
    Assert.notNull(group);/*from w w w.  jav  a  2s.c o m*/
    Assert.hasText(group.getDisplayName());

    group.setSchemas(SCHEMAS);

    return helper.post("/Groups", group, GROUP_REF);
}

From source file:com.emc.vipr.sync.target.CasTarget.java

@Override
public void configure(SyncSource source, Iterator<SyncFilter> filters, SyncTarget target) {
    if (!(source instanceof CasSource))
        throw new ConfigurationException("CasTarget is currently only compatible with CasSource");

    Assert.hasText(connectionString);//from  w ww  .  j a  va 2 s .c o  m

    try {
        FPPool.RegisterApplication(APPLICATION_NAME, APPLICATION_VERSION);

        // Check connection
        pool = new FPPool(connectionString);
        FPPool.PoolInfo info = pool.getPoolInfo();
        LogMF.info(l4j, "Connected to target: {0} ({1}) using CAS v.{2}", info.getClusterName(),
                info.getClusterID(), info.getVersion());

        // verify we have appropriate privileges
        if (pool.getCapability(FPLibraryConstants.FP_WRITE, FPLibraryConstants.FP_ALLOWED).equals("False"))
            throw new IllegalArgumentException("WRITE is not supported for this pool connection");
    } catch (FPLibraryException e) {
        throw new RuntimeException("error creating pool", e);
    }
}

From source file:org.cloudfoundry.identity.uaa.api.user.impl.UaaUserOperationsImpl.java

public void changeUserPassword(String userId, String newPassword) {
    Assert.hasText(userId);
    Assert.hasText(newPassword);/*from ww w  . j  a  v  a2 s  .c  o m*/

    helper.put("/Users/{id}/password", Collections.singletonMap("password", newPassword), STRING_REF, userId);
}